def test_section3_post(self): request = self.factory.post("/section-3/", dict()) request.user = self.u response = generic_view_page(request, "section-3/", template="pagetree/test_page.html") self.assertEqual(response.status_code, 302)
def test_section1(self): request = self.factory.get("/section-1/") request.user = self.u response = generic_view_page(request, "section-1/", template="pagetree/test_page.html") self.assertEqual(response.status_code, 200)
def test_section3_post(self): request = self.factory.post("/section-3/", dict()) request.user = self.u response = generic_view_page( request, "section-3/", template="pagetree/test_page.html") self.assertEqual(response.status_code, 302)
def test_section1(self): request = self.factory.get("/section-1/") request.user = self.u response = generic_view_page( request, "section-1/", template="pagetree/test_page.html") self.assertEqual(response.status_code, 200)
def test_section2(self): request = self.factory.get("/section-2/") request.user = self.u response = generic_view_page(request, "section-2/", extra_context=dict(foo='bar'), template="pagetree/test_page.html") self.assertEqual(response.status_code, 200)
def test_section2(self): request = self.factory.get("/section-2/") request.user = self.u response = generic_view_page( request, "section-2/", extra_context=dict(foo='bar'), template="pagetree/test_page.html") self.assertEqual(response.status_code, 200)
def test_root(self): request = self.factory.get("/") response = generic_view_page(request, "/") self.assertEqual(response.status_code, 302)
def test_nonexistant(self): request = self.factory.get("/foo/") with self.assertRaises(Http404): generic_view_page(request, "/foo/")