Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 def test_root(self):
     request = self.factory.get("/")
     response = generic_view_page(request, "/")
     self.assertEqual(response.status_code, 302)
Exemplo n.º 8
0
 def test_nonexistant(self):
     request = self.factory.get("/foo/")
     with self.assertRaises(Http404):
         generic_view_page(request, "/foo/")
Exemplo n.º 9
0
 def test_root(self):
     request = self.factory.get("/")
     response = generic_view_page(request, "/")
     self.assertEqual(response.status_code, 302)
Exemplo n.º 10
0
 def test_nonexistant(self):
     request = self.factory.get("/foo/")
     with self.assertRaises(Http404):
         generic_view_page(request, "/foo/")