From 5345c6e3640cc5f356b55348a5834e3a1987532d Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 13 Nov 2012 15:06:49 +0100 Subject: [PATCH] Test fix --- apps/api/handlers.py | 2 +- apps/catalogue/tests/tags.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/api/handlers.py b/apps/api/handlers.py index be5993cd9..dbe905b00 100644 --- a/apps/api/handlers.py +++ b/apps/api/handlers.py @@ -138,7 +138,7 @@ class BookDetails(object): @classmethod def cover_thumb(cls, book): return MEDIA_BASE + default.backend.get_thumbnail( - book.cover, "139x193").url + book.cover, "139x193").url if book.cover else '' 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)]) -- 2.20.1