X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/60b06883b6d5a336ef47c01103ec1ce25aafae69..ccf1868db403f603a87db2194a8ced22a05766f1:/apps/dictionary/tests.py?ds=sidebyside diff --git a/apps/dictionary/tests.py b/apps/dictionary/tests.py index 0de7c5e6d..526819a01 100755 --- a/apps/dictionary/tests.py +++ b/apps/dictionary/tests.py @@ -5,7 +5,6 @@ from django.core.files.base import ContentFile from catalogue.test_utils import * from catalogue.models import Book -from dictionary.models import Note class DictionaryTests(WLTestCase): @@ -13,19 +12,19 @@ class DictionaryTests(WLTestCase): def setUp(self): WLTestCase.setUp(self) self.book_info = BookInfoStub( - url=u"http://wolnelektury.pl/example/default-book", - about=u"http://wolnelektury.pl/example/URI/default_book", - title=u"Default Book", 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. """ @@ -33,16 +32,21 @@ class DictionaryTests(WLTestCase): self.assertEqual( len(self.client.get('/przypisy/').context['object_list']), - 1, + 2, 'There should be a note on the note list.') self.assertEqual( - len(self.client.get('/przypisy/a/').context['object_list']), + 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/r/').context['object_list']), - 1, + 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.')