Skip to content

Commit

Permalink
Test logs are updated when 'email_sent_for_modification' is True
Browse files Browse the repository at this point in the history
  • Loading branch information
chloend committed Dec 24, 2024
1 parent 02f914b commit c6118a9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lemarche/tenders/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down

0 comments on commit c6118a9

Please sign in to comment.