Example #1
0
 def test_user_somehow_not_authenticated(self):
     request = RequestFactory().get('/')
     request.user = AnonymousUser()
     assert not DisposableEmailDomainRestriction.allow_request(request)
Example #2
0
 def test_email_domain_blocked(self):
     DisposableEmailDomainRestriction.objects.create(domain='bar.com')
     request = RequestFactory().get('/')
     request.user = user_factory(email='*****@*****.**')
     assert not DisposableEmailDomainRestriction.allow_request(request)