Skip to content

Commit

Permalink
Add more asserts to make sure cod_unidade_executora is correct
Browse files Browse the repository at this point in the history
  • Loading branch information
augusto-herrmann committed Aug 30, 2024
1 parent 1ab7865 commit 7d76cdd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/plano_trabalho/participante_outra_lotacao.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def test_create_plano_trabalho_participante_outra_unidade(self, input_part):
)

assert response.status_code == status.HTTP_201_CREATED
self.assert_equal_plano_trabalho(response.json(), self.input_pt)
response_data = response.json()
self.assert_equal_plano_trabalho(response_data, self.input_pt)
# verifica se a resposta veio com o cod_unidade_executora esperado
assert response_data['cod_unidade_executora'] == 101

# Consulta API para conferir se a criação foi persistida
response = self.get_plano_trabalho(
Expand All @@ -44,5 +47,9 @@ def test_create_plano_trabalho_participante_outra_unidade(self, input_part):
)

assert response.status_code == status.HTTP_200_OK
response_data = response.json()

# verifica se os dados gravados são iguais aos informados
self.assert_equal_plano_trabalho(response.json(), self.input_pt)
self.assert_equal_plano_trabalho(response_data, self.input_pt)
# verifica o cod_unidade_executora
assert response_data['cod_unidade_executora'] == 101

0 comments on commit 7d76cdd

Please sign in to comment.