X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/06aa9a0cfb91249b55aafe26967730c3ea29ad96..5345c6e3640cc5f356b55348a5834e3a1987532d:/apps/catalogue/tests/tags.py diff --git a/apps/catalogue/tests/tags.py b/apps/catalogue/tests/tags.py index 3eab3da4d..2608eb632 100644 --- a/apps/catalogue/tests/tags.py +++ b/apps/catalogue/tests/tags.py @@ -277,12 +277,11 @@ class BookTagsTests(WLTestCase): self.assertEqual([(tag.name, tag.count) for tag in related_themes], [('ChildTheme', 1), ('ParentTheme', 1), ('Theme', 2)]) - def test_main_page_tags(self): + def test_catalogue_tags(self): """ test main page tags and counts """ - from catalogue.templatetags.catalogue_tags import catalogue_menu - menu = catalogue_menu() - self.assertEqual([(tag.name, tag.book_count) for tag in menu['author']], + context = self.client.get('/katalog/').context + self.assertEqual([(tag.name, tag.book_count) for tag in context['categories']['author']], [('Jim Lazy', 1), ('Common Man', 1)]) - self.assertEqual([(tag.name, tag.book_count) for tag in menu['theme']], + self.assertEqual([(tag.name, tag.book_count) for tag in context['categories']['theme']], [('ChildTheme', 1), ('ParentTheme', 1), ('Theme', 2)])