Пример #1
0
 def test_init_set_home(self):
     # create page (is not a home page)
     init_page(self.HOME, 0)
     page = Page.objects.get(slug=self.SLUG)
     self.assertFalse(page.is_home)
     # update page (is now a home page)
     init_page(self.HOME, 0, is_home=True)
     page = Page.objects.get(slug=self.SLUG)
     self.assertTrue(page.is_home)
Пример #2
0
 def test_init_set_home(self):
     # create page (is not a home page)
     init_page(self.HOME, 0)
     page = Page.objects.get(slug=self.SLUG)
     self.assertFalse(page.is_home)
     # update page (is now a home page)
     init_page(self.HOME, 0, is_home=True)
     page = Page.objects.get(slug=self.SLUG)
     self.assertTrue(page.is_home)
Пример #3
0
 def test_init_change_order(self):
     # create page (order 1)
     init_page(self.HOME, 1)
     page = Page.objects.get(slug=self.SLUG)
     self.assertEqual(1, page.order)
     # update page (order 3)
     init_page(self.HOME, 3)
     page = Page.objects.get(slug=self.SLUG)
     self.assertEqual(3, page.order)
Пример #4
0
 def test_init_change_order(self):
     # create page (order 1)
     init_page(self.HOME, 1)
     page = Page.objects.get(slug=self.SLUG)
     self.assertEqual(1, page.order)
     # update page (order 3)
     init_page(self.HOME, 3)
     page = Page.objects.get(slug=self.SLUG)
     self.assertEqual(3, page.order)
Пример #5
0
 def test_init_is_not_home(self):
     init_page(self.HOME, 0)
     page = Page.objects.get(slug=self.SLUG)
     self.assertFalse(page.is_home)
Пример #6
0
 def test_init_is_home(self):
     init_page(self.HOME, 0, is_home=True)
     page = Page.objects.get(slug=self.SLUG)
     self.assertTrue(page.is_home)
Пример #7
0
 def test_init(self):
     init_page(self.HOME, 0)
     try:
         Page.objects.get(slug=self.SLUG)
     except Page.DoesNotExist:
         self.fail("'{}' page was not initialised".format(self.SLUG))
Пример #8
0
 def test_init_is_not_home(self):
     init_page(self.HOME, 0)
     page = Page.objects.get(slug=self.SLUG)
     self.assertFalse(page.is_home)
Пример #9
0
 def test_init_is_home(self):
     init_page(self.HOME, 0, is_home=True)
     page = Page.objects.get(slug=self.SLUG)
     self.assertTrue(page.is_home)
Пример #10
0
 def test_init(self):
     init_page(self.HOME, 0)
     try:
         Page.objects.get(slug=self.SLUG)
     except Page.DoesNotExist:
         self.fail("'{}' page was not initialised".format(self.SLUG))