def test_more_nested_uses_fallback_to_parents(self): tools.assert_equals([ u'page/category/nested-category/second-nested-category/category.html', u'page/category/nested-category/category.html', u'page/category.html' ], get_templates('category.html', category=self.category_nested_second))
def test_more_nested_uses_fallback_to_parents(self): tools.assert_equals( [ u"page/category/nested-category/second-nested-category/category.html", u"page/category/nested-category/category.html", u"page/category.html", ], get_templates("category.html", category=self.category_nested_second), )
def __get_templates(self, context): " Extract parameters for `get_templates` from the context. " kw = {} if "object" in context: o = context["object"] kw["slug"] = o.slug if context.get("content_type", False): ct = context["content_type"] kw["app_label"] = ct.app_label kw["model_label"] = ct.model return get_templates(self.template_name, category=context["category"], **kw)
def test_first_nested_uses_only_path(self): tools.assert_equals( [u'page/category/nested-category/category.html', u'page/category.html'], get_templates('category.html', category=self.category_nested) )
def test_homepage_uses_only_path(self): tools.assert_equals( [u'page/category/ni-hao-category/category.html', u'page/category.html'], get_templates('category.html', category=self.category) )
def test_first_nested_uses_only_path(self): tools.assert_equals( [u"page/category/nested-category/category.html", u"page/category.html"], get_templates("category.html", category=self.category_nested), )
def test_homepage_uses_only_path(self): tools.assert_equals( [u"page/category/ni-hao-category/category.html", u"page/category.html"], get_templates("category.html", category=self.category), )