def test_getting_category_for_templatag_from_category_tree_path(self): tools.assert_equals( _get_category_from_pars_var( template.Variable('"%s"' % (self.category.tree_path)), self.context), self.category) tools.assert_equals( _get_category_from_pars_var( template.Variable('"%s"' % (self.category_nested.tree_path)), self.context), self.category_nested)
def test_getting_category_for_templatag_from_category_tree_path(self): tools.assert_equals(_get_category_from_pars_var(template.Variable('"%s"' % (self.category.tree_path)), self.context), self.category) tools.assert_equals(_get_category_from_pars_var(template.Variable('"%s"' % (self.category_nested.tree_path)), self.context), self.category_nested)
def test_getting_category_for_templatag_from_category_tree_path_in_variable(self): context = Context({'category': '%s' % (self.category.tree_path)}) tools.assert_equals(_get_category_from_pars_var(template.Variable('category'), context), self.category)
def test_getting_category_for_templatag_from_category_variable(self): tools.assert_equals(_get_category_from_pars_var(template.Variable('category'), self.context), self.category)