def test_create_django_response(self): request = Request(path="/foo") response = create_django_response(request) self.assertEqual(response.status_code, 404, "status code on create_django_response") self.assertTrue("File not found" in response.content, "content on create_django_response")
def test_login_as(self): user = User.objects.create_user(username = TEST_USER, password = TEST_PASS, email = TEST_USER) request = Request(path = "/foo", login_as_user = user) request.save() response = create_django_response(request) self.assertTrue(response.context["user"].is_authenticated())
def test_login_as(self): user = User.objects.create_user(username=TEST_USER, password=TEST_PASS, email=TEST_USER) request = Request(path="/foo", login_as_user=user) request.save() response = create_django_response(request) self.assertTrue(response.context["user"].is_authenticated())
def test_create_django_response(self): request = Request(path = "/foo") response = create_django_response(request) self.assertEqual(response.status_code, 404, "status code on create_django_response") self.assertTrue("File not found" in response.content, "content on create_django_response")