X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/527c5dba85fcdfd70755b6c1f899dbb21f5ec40a..357027375ff8867f42ca34bcbfb5a78b5b185fc3:/apps/dictionary/tests.py diff --git a/apps/dictionary/tests.py b/apps/dictionary/tests.py deleted file mode 100755 index 526819a01..000000000 --- a/apps/dictionary/tests.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -from django.core.files.base import ContentFile -from catalogue.test_utils import * -from catalogue.models import Book - - -class DictionaryTests(WLTestCase): - - def setUp(self): - WLTestCase.setUp(self) - self.book_info = BookInfoStub( - author=PersonStub(("Jim",), "Lazy"), - kind="X-Kind", - genre="X-Genre", - epoch="X-Epoch", - **info_args(u"Default Book") - ) - - def test_book_with_footnote(self): - BOOK_TEXT = """ - - rose --- kind of a flower. - rose --- kind of a flower. - rose (color) --- #FF007F. - - """ - - book = Book.from_text_and_meta(ContentFile(BOOK_TEXT), self.book_info) - - self.assertEqual( - len(self.client.get('/przypisy/').context['object_list']), - 2, - 'There should be a note on the note list.') - - self.assertEqual( - len(self.client.get('/przypisy/?ltr=r').context['object_list']), - 0, - 'There should not be a note for the letter A.') - - self.assertEqual( - len(self.client.get('/przypisy/?ltr=r').context['object_list']), - 2, - 'There should be a note for the letter R.') - - self.assertEqual( - len(self.client.get('/przypisy/?qual=color').context['object_list']), - 2, - 'There should be a note for the letter R.') -