From 407ff0cb76bdae7c509d5af0b33c867f62ee7e6b Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:13:56 -0600 Subject: [PATCH] missing unit test --- src/registrar/tests/test_admin.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index f0a40044b..b29776f81 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -1341,7 +1341,10 @@ class TestDomainRequestAdmin(MockEppLib): ("phone", "(555) 555 5555"), ] self.assert_response_contains_distinct_values(response, expected_ao_fields) - self.assertContains(response, "Testy Tester") + + # count=4 because the underlying domain has two users with this name. + # The dropdown has 3 of these. + self.assertContains(response, "Testy Tester", count=4) # Check for table titles. We only need to check for the end tag # (Otherwise this test will fail if we change classes, etc) @@ -1355,6 +1358,18 @@ class TestDomainRequestAdmin(MockEppLib): # Phone. Count=3 because this table appears on three records. self.assertContains(response, "Phone", count=3) + # == Test the other_employees field == # + expected_other_employees_fields = [ + # Field, expected value + ("title", "Another Tester"), + ("email", "testy2@town.com"), + ("phone", "(555) 555 5557"), + ] + self.assert_response_contains_distinct_values(response, expected_other_employees_fields) + + # count=1 as only one should exist in a table + self.assertContains(response, "Testy Tester", count=1) + def test_save_model_sets_restricted_status_on_user(self): with less_console_noise(): # make sure there is no user with this email