From e0ba0807f31f1ad1facaec3988be4d88e98dde6c Mon Sep 17 00:00:00 2001 From: dunossauro Date: Fri, 4 Oct 2024 22:49:12 -0300 Subject: [PATCH] =?UTF-8?q?Ajustando=20resposta=20do=20exerc=C3=ADcio=2002?= =?UTF-8?q?=20da=20aula=2004?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aulas/exercicios_resolvidos/aula_04.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aulas/exercicios_resolvidos/aula_04.md b/aulas/exercicios_resolvidos/aula_04.md index 97907cb5..96b5f289 100644 --- a/aulas/exercicios_resolvidos/aula_04.md +++ b/aulas/exercicios_resolvidos/aula_04.md @@ -41,7 +41,7 @@ A ideia é adicionar mais um campo na verificação do modelo, para que o update ```python hl_lines="7 8" @contextmanager -def mock_db_time(*, model, time=datetime(2024, 1, 1)): +def _mock_db_time(*, model, time=datetime(2024, 1, 1)): def fake_time_handler(mapper, connection, target): if hasattr(target, 'created_at'): @@ -59,7 +59,7 @@ def mock_db_time(*, model, time=datetime(2024, 1, 1)): Com a alteração do modelo, o teste também passará a falhar. Isso pode ser modificado adicionando o campo `updated_at` no dicionário de validação: ```python hl_lines="17" -def test_create_user(session): +def test_create_user(session, mock_db_time): with mock_db_time(model=User) as time: new_user = User( username='alice', password='secret', email='teste@test'