From d9222864f975ba977875b1d71fd966e39d4aa3c2 Mon Sep 17 00:00:00 2001 From: Rachid Mrad Date: Thu, 25 Jan 2024 15:29:51 -0500 Subject: [PATCH] Fix pks in new tests to be aware of dynamic changes --- src/registrar/tests/test_admin.py | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index 4bd58db25..43771a260 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -1747,10 +1747,10 @@ class ContactAdminTest(TestCase): contact, _ = Contact.objects.get_or_create(user=self.staffuser) # join it to 4 domain requests. The 5th join will be a user. - completed_application(submitter=contact, name="city1.gov") - completed_application(submitter=contact, name="city2.gov") - completed_application(submitter=contact, name="city3.gov") - completed_application(submitter=contact, name="city4.gov") + application1 = completed_application(submitter=contact, name="city1.gov") + application2 = completed_application(submitter=contact, name="city2.gov") + application3 = completed_application(submitter=contact, name="city3.gov") + application4 = completed_application(submitter=contact, name="city4.gov") with patch("django.contrib.messages.warning") as mock_warning: # Use the test client to simulate the request @@ -1762,10 +1762,10 @@ class ContactAdminTest(TestCase): # Note: The 5th join will be a user. mock_warning.assert_called_once_with( response.wsgi_request, - "Joined to DomainApplication: city1.gov
" - "Joined to DomainApplication: city2.gov
" - "Joined to DomainApplication: city3.gov
" - "Joined to DomainApplication: city4.gov
" + f"Joined to DomainApplication: city1.gov
" + f"Joined to DomainApplication: city2.gov
" + f"Joined to DomainApplication: city3.gov
" + f"Joined to DomainApplication: city4.gov
" "Joined to User: staff@example.com
", ) @@ -1778,11 +1778,11 @@ class ContactAdminTest(TestCase): # Create an instance of the model # join it to 5 domain requests. The 6th join will be a user. contact, _ = Contact.objects.get_or_create(user=self.staffuser) - completed_application(submitter=contact, name="city1.gov") - completed_application(submitter=contact, name="city2.gov") - completed_application(submitter=contact, name="city3.gov") - completed_application(submitter=contact, name="city4.gov") - completed_application(submitter=contact, name="city5.gov") + application1 = completed_application(submitter=contact, name="city1.gov") + application2 = completed_application(submitter=contact, name="city2.gov") + application3 = completed_application(submitter=contact, name="city3.gov") + application4 = completed_application(submitter=contact, name="city4.gov") + application5 = completed_application(submitter=contact, name="city5.gov") with patch("django.contrib.messages.warning") as mock_warning: # Use the test client to simulate the request @@ -1794,11 +1794,11 @@ class ContactAdminTest(TestCase): # Note: The 6th join will be a user. mock_warning.assert_called_once_with( response.wsgi_request, - "Joined to DomainApplication: city1.gov
" - "Joined to DomainApplication: city2.gov
" - "Joined to DomainApplication: city3.gov
" - "Joined to DomainApplication: city4.gov
" - "Joined to DomainApplication: city5.gov
" + f"Joined to DomainApplication: city1.gov
" + f"Joined to DomainApplication: city2.gov
" + f"Joined to DomainApplication: city3.gov
" + f"Joined to DomainApplication: city4.gov
" + f"Joined to DomainApplication: city5.gov
" "And 1 more...", )