From c6118a93ce26f8dd0b28f652a1888cc6ad66ba21 Mon Sep 17 00:00:00 2001 From: Chloend Date: Tue, 24 Dec 2024 10:40:30 +0100 Subject: [PATCH] Test logs are updated when 'email_sent_for_modification' is True --- lemarche/tenders/tests/test_models.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lemarche/tenders/tests/test_models.py b/lemarche/tenders/tests/test_models.py index 07adb576e..a18b7ddbb 100644 --- a/lemarche/tenders/tests/test_models.py +++ b/lemarche/tenders/tests/test_models.py @@ -1080,8 +1080,8 @@ def test_edit_form_validate_submission_to_commercial_partners(self): self.assertContains(response, "Validé le ") self.assertTrue(tender_response.send_to_commercial_partners_only) - def test_email_sent_for_modification_updates_status(self): - """Test 'email_sent_for_modification' updates tender status""" + def test_email_sent_for_modification_updates_status_and_logs(self): + """Test 'email_sent_for_modification' updates tender status and logs""" self.client.force_login(self.user) tender_update_post_url = get_admin_change_view_url(self.tender) @@ -1098,6 +1098,11 @@ def test_email_sent_for_modification_updates_status(self): tender_response = response.context_data["adminform"].form.instance self.assertEqual(tender_response.status, tender_constants.STATUS_DRAFT) + # Tender logs 'send_tender_autor_modification_request' date + log_entry = tender_response.logs[0] + self.assertEqual(log_entry["action"], "send_tender_author_modification_request") + self.assertIn("email_sent_at", log_entry) + def test_changes_information_cannot_be_edited_if_email_not_sent(self): """Test changes_information cannot be edited if email not sent.""" self.client.force_login(self.user)