def test_for_AnonymousUser(self): request = self.factory.get('/todo/') request.user = AnonymousUser() request.session = {} response = task_page(request) self.assertNotEqual(response.status_code, 200) self.assertEqual(response.status_code, 302)
def test_for_logged_in_user(self): request = self.factory.get('/todo/') request.user = self.user response = task_page(request) self.assertEqual(response.status_code, 200)