class TestCategoryDetail(ViewHelpersTestCase): def setUp(self): super(TestCategoryDetail, self).setUp() self.category_detail = CategoryDetail() def test_returns_category_by_tree_path(self): c = self.category_detail.get_context(self.request, 'nested-category') self.assert_equals(self.category_nested, c['category']) self.assert_false(c['is_homepage']) def test_returns_home_page_with_no_args(self): c = self.category_detail.get_context(self.request) self.assert_equals(self.category, c['category']) self.assert_true(c['is_homepage']) def test_returns_nested_category_by_tree_path(self): c = self.category_detail.get_context(self.request, 'nested-category/second-nested-category') self.assert_equals(self.category_nested_second, c['category']) self.assert_false(c['is_homepage'])
def setUp(self): super(TestCategoryDetail, self).setUp() self.category_detail = CategoryDetail()