From 04d3b92f9665fc676e3cbdda8f7415de963e697b Mon Sep 17 00:00:00 2001 From: Rachid Mrad Date: Thu, 14 Dec 2023 13:23:27 -0500 Subject: [PATCH] fix merge error: misplaced test: test_check_domain_invitations_on_login_caps_email --- src/registrar/tests/test_models.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/registrar/tests/test_models.py b/src/registrar/tests/test_models.py index 3854528b4..51a89a359 100644 --- a/src/registrar/tests/test_models.py +++ b/src/registrar/tests/test_models.py @@ -654,6 +654,20 @@ class TestUser(TestCase): """A new user who's neither transitioned nor invited should return True when tested with class method needs_identity_verification""" self.assertTrue(User.needs_identity_verification(self.user.email, self.user.username)) + + def test_check_domain_invitations_on_login_caps_email(self): + """A DomainInvitation with an email address with capital letters should match + a User record whose email address is not in caps""" + # create DomainInvitation with CAPS email that matches User email + # on a case-insensitive match + caps_email = "MAYOR@igorville.gov" + # mock the domain invitation save routine + with patch("registrar.models.DomainInvitation.save") as save_mock: + DomainInvitation.objects.get_or_create(email=caps_email, domain=self.domain) + self.user.check_domain_invitations_on_login() + # if check_domain_invitations_on_login properly matches exactly one + # Domain Invitation, then save routine should be called exactly once + save_mock.assert_called_once() class TestContact(TestCase): @@ -700,16 +714,3 @@ class TestContact(TestCase): self.assertEqual(self.contact.email, "joey.baloney@diaperville.com") self.assertEqual(self.user.email, "mayor@igorville.gov") - def test_check_domain_invitations_on_login_caps_email(self): - """A DomainInvitation with an email address with capital letters should match - a User record whose email address is not in caps""" - # create DomainInvitation with CAPS email that matches User email - # on a case-insensitive match - caps_email = "MAYOR@igorville.gov" - # mock the domain invitation save routine - with patch("registrar.models.DomainInvitation.save") as save_mock: - DomainInvitation.objects.get_or_create(email=caps_email, domain=self.domain) - self.user.check_domain_invitations_on_login() - # if check_domain_invitations_on_login properly matches exactly one - # Domain Invitation, then save routine should be called exactly once - save_mock.assert_called_once()