Esempio n. 1
0
 def test_lazy_user_enters_requires_nonlazy_decorator(self):
     self.request.user, _ = LazyUser.objects.create_lazy_user()
     try:
         requires_nonlazy_view(self.request)
     except NoReverseMatch:
         e = sys.exc_info()[1]
         self.assertTrue("view-for-lazy-users" in e.args[0])
Esempio n. 2
0
 def test_lazy_user_enters_requires_nonlazy_decorator(self):
     self.request.user, _ = LazyUser.objects.create_lazy_user()
     try:
         requires_nonlazy_view(self.request)
     except NoReverseMatch:
         e = sys.exc_info()[1]
         self.assertTrue("view-for-lazy-users" in e.args[0])
Esempio n. 3
0
 def test_nonlazy_user_enters_requires_nonlazy_decorator(self):
     self.request.user = AnonymousUser()
     response = requires_nonlazy_view(self.request)
     self.assertEqual(response.status_code, 200)
Esempio n. 4
0
 def test_nonlazy_user_enters_requires_nonlazy_decorator(self):
     self.request.user = AnonymousUser()
     response = requires_nonlazy_view(self.request)
     self.assertEqual(response.status_code, 200)