Skip to content

Commit

Permalink
Fix pytest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
syldb committed Sep 26, 2024
1 parent 8e5a137 commit b7e6317
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion conventions/tests/views/test_journal_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ def test_create_journal_evenement(self):
"""
# login as superuser
self.client.post(reverse("login"), {"username": "nicolas", "password": "12345"})

response = self.client.post(
self.target_path,
{
"action": "submit",
"description": "Signé par le préfet",
"type_evenement": TypeEvenement.RETOUR_PREFET,
"piece_jointe": "filename.jpg",
"piece_jointe_files": "",
},
)
self.assertEqual(response.status_code, 200, msg="[ConventionJournalTests] ")
Expand All @@ -60,6 +61,7 @@ def test_create_journal_evenement(self):
self.assertIsNotNone(evenement)
self.assertEqual(evenement.description, "Signé par le préfet")
self.assertEqual(evenement.type_evenement, TypeEvenement.RETOUR_PREFET)
assert evenement.piece_jointe == '{"files": [], "text": "filename.jpg"}'

def test_edit_journal_evenement(self):
"""
Expand All @@ -76,6 +78,8 @@ def test_edit_journal_evenement(self):
"uuid": self.convention_75.evenements.first().uuid,
"description": "Contact prélimiaire au préfet pour signature",
"type_evenement": TypeEvenement.ECHANGE,
"piece_jointe": "filename_update.jpg",
"piece_jointe_files": "",
},
)
self.assertEqual(response.status_code, 200, msg="[ConventionJournalTests] ")
Expand All @@ -90,3 +94,4 @@ def test_edit_journal_evenement(self):
"Contact prélimiaire au préfet pour signature",
)
self.assertEqual(evenement.type_evenement, TypeEvenement.ECHANGE)
assert evenement.piece_jointe == '{"files": [], "text": "filename_update.jpg"}'

0 comments on commit b7e6317

Please sign in to comment.