mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-20 11:29:25 +02:00
fix merge error: misplaced test: test_check_domain_invitations_on_login_caps_email
This commit is contained in:
parent
419eaf8709
commit
04d3b92f96
1 changed files with 14 additions and 13 deletions
|
@ -654,6 +654,20 @@ class TestUser(TestCase):
|
||||||
"""A new user who's neither transitioned nor invited should
|
"""A new user who's neither transitioned nor invited should
|
||||||
return True when tested with class method needs_identity_verification"""
|
return True when tested with class method needs_identity_verification"""
|
||||||
self.assertTrue(User.needs_identity_verification(self.user.email, self.user.username))
|
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):
|
class TestContact(TestCase):
|
||||||
|
@ -700,16 +714,3 @@ class TestContact(TestCase):
|
||||||
self.assertEqual(self.contact.email, "joey.baloney@diaperville.com")
|
self.assertEqual(self.contact.email, "joey.baloney@diaperville.com")
|
||||||
self.assertEqual(self.user.email, "mayor@igorville.gov")
|
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()
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue