def test_ip_denied(self): req = self.get_request() req.META['REMOTE_ADDR'] = '10.10.10.1' assert not EmailCreationPermission().has_permission(req, None)
def test_token_denied(self): req = self.get_request() req.META['HTTP_POSTFIX_AUTH_TOKEN'] = 'somethingwrong' assert not EmailCreationPermission().has_permission(req, None)
def test_allowed(self): assert EmailCreationPermission().has_permission( self.get_request(), None)