X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/378665e6e0ee8595e3c97096331bab365845cd9e..f82c33291d3bf97d7447aba236940bdfe560f703:/apps/dictionary/tests.py?ds=sidebyside diff --git a/apps/dictionary/tests.py b/apps/dictionary/tests.py index 27285cc14..0c83cf183 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): @@ -24,6 +23,8 @@ class DictionaryTests(WLTestCase): BOOK_TEXT = """ rose --- kind of a flower. + rose --- kind of a flower. + rose (techn.) --- #FF007F. """ @@ -31,16 +32,21 @@ class DictionaryTests(WLTestCase): self.assertEqual( len(self.client.get('/przypisy/').context['object_list']), - 1, - 'There should be a note on the note list.') + 2, + 'There should be two notes on the note list.') self.assertEqual( - len(self.client.get('/przypisy/a/').context['object_list']), + len(self.client.get('/przypisy/?ltr=a').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']), + len(self.client.get('/przypisy/?ltr=r').context['object_list']), + 2, + 'Both notes start with the letter R.') + + self.assertEqual( + len(self.client.get('/przypisy/?qual=techn.').context['object_list']), 1, - 'There should be a note for the letter R.') + 'There should be a note qualified with \'techn.\' qualifier.')