Example #1
0
 def test_anonymous_invalid(self):
     user = User.objects.create_user(username='******',
                                     email='test@user')
     self.request.user = user
     self.assertFalse(anonymous_condition(True, request=self.request))
Example #2
0
 def test_request_required(self):
     with self.assertRaises(RequiredForCondition):
         anonymous_condition(True)
Example #3
0
 def test_anonymous_valid(self):
     self.request.user = AnonymousUser()
     self.assertTrue(anonymous_condition(True, request=self.request))