def test_get_template_names_from_page(self): """Returns custom template""" view = FiberTemplateView() view.request = RequestFactory().get(self.template_page.url) self.assertEqual(view.get_template_names(), "template1.html")
def test_get_fiber_page_for_non_fiber_url(self): """Returns requested page""" view = FiberTemplateView() view.request = RequestFactory().get("/empty/") self.assertIsNone(view.get_fiber_page())
def test_get_template_names_default(self): """Returns default template""" view = FiberTemplateView() view.request = RequestFactory().get(self.frontpage.url) self.assertEqual(view.get_template_names(), "base.html")
def test_get_fiber_page(self): """Returns requested page""" view = FiberTemplateView() view.request = RequestFactory().get(self.frontpage.url) self.assertEqual(view.get_fiber_page(), self.frontpage)
def test_get_template_names_from_page(self): """Returns custom template""" view = FiberTemplateView() view.request = RequestFactory().get(self.template_page.url) self.assertEqual(view.get_template_names(), 'template1.html')
def test_get_template_names_default(self): """Returns default template""" view = FiberTemplateView() view.request = RequestFactory().get(self.frontpage.url) self.assertEqual(view.get_template_names(), 'base.html')
def test_get_fiber_page_for_non_fiber_url(self): """Returns requested page""" view = FiberTemplateView() view.request = RequestFactory().get('/empty/') self.assertIsNone(view.get_fiber_page())