1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from django.core.files.base import ContentFile
6 from catalogue.test_utils import *
7 from catalogue.models import Book
10 class DictionaryTests(WLTestCase):
13 WLTestCase.setUp(self)
14 self.book_info = BookInfoStub(
15 author=PersonStub(("Jim",), "Lazy"),
19 **info_args(u"Default Book")
22 def test_book_with_footnote(self):
23 BOOK_TEXT = """<utwor>
25 <akap><pe><slowo_obce>rose</slowo_obce> --- kind of a flower.</pe></akap>
26 </opowiadanie></utwor>
29 book = Book.from_text_and_meta(ContentFile(BOOK_TEXT), self.book_info)
32 len(self.client.get('/przypisy/').context['object_list']),
34 'There should be a note on the note list.')
37 len(self.client.get('/przypisy/a/').context['object_list']),
39 'There should not be a note for the letter A.')
42 len(self.client.get('/przypisy/r/').context['object_list']),
44 'There should be a note for the letter R.')