X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3d1fb545dd1f49e0624d3adf20e5568b1c33d8ec..76a5ef1307add0a97470e8927e2b3165a8d95b29:/apps/catalogue/tests/tags.py diff --git a/apps/catalogue/tests/tags.py b/apps/catalogue/tests/tags.py index 7e6e66716..a47e426a5 100644 --- a/apps/catalogue/tests/tags.py +++ b/apps/catalogue/tests/tags.py @@ -3,9 +3,6 @@ from catalogue import models from catalogue.test_utils import * from django.core.files.base import ContentFile -from nose.tools import raises - - class BooksByTagTests(WLTestCase): """ tests the /katalog/category/tag page for found books """ @@ -66,12 +63,13 @@ class BooksByTagTests(WLTestCase): ['Child']) - +from django.test import Client class TagRelatedTagsTests(WLTestCase): """ tests the /katalog/category/tag/ page for related tags """ def setUp(self): WLTestCase.setUp(self) + self.client = Client() author = PersonStub(("Common",), "Man") gchild_info = BookInfoStub(author=author, genre="GchildGenre", epoch='Epoch', kind="Kind", @@ -132,14 +130,14 @@ class TagRelatedTagsTests(WLTestCase): def test_related_differ(self): """ related tags shouldn't include filtering tags """ - cats = self.client.get('/katalog/rodzaj/kind/').context['categories'] + response = self.client.get('/katalog/rodzaj/kind/') + cats = response.context['categories'] self.assertFalse('Kind' in [tag.name for tag in cats['kind']], 'filtering tag wrongly included in related') cats = self.client.get('/katalog/motyw/theme/').context['categories'] self.assertFalse('Theme' in [tag.name for tag in cats['theme']], 'filtering theme wrongly included in related') - def test_parent_tag_once(self): """ if parent and descendants have a common tag, count it only once """