def test_user_somehow_not_authenticated(self): request = RequestFactory().get('/') request.user = AnonymousUser() assert not DisposableEmailDomainRestriction.allow_request(request)
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)