fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests back up
[wolnelektury.git]
/
src
/
dictionary
/
tests.py
diff --git
a/src/dictionary/tests.py
b/src/dictionary/tests.py
old mode 100755
(executable)
new mode 100644
(file)
index
0c83cf1
..
ae92530
--- a/
src/dictionary/tests.py
+++ b/
src/dictionary/tests.py
@@
-1,10
+1,10
@@
-# -*- 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.
+# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
#
from django.core.files.base import ContentFile
from catalogue.test_utils import *
from catalogue.models import Book
#
from django.core.files.base import ContentFile
from catalogue.test_utils import *
from catalogue.models import Book
+from django.contrib.auth.models import User
class DictionaryTests(WLTestCase):
class DictionaryTests(WLTestCase):
@@
-16,11
+16,14
@@
class DictionaryTests(WLTestCase):
kind="X-Kind",
genre="X-Genre",
epoch="X-Epoch",
kind="X-Kind",
genre="X-Genre",
epoch="X-Epoch",
- **info_args(
u
"Default Book")
+ **info_args("Default Book")
)
)
+ self.user = User.objects.create(username='test')
+ self.user.set_password('test')
+ self.user.save()
def test_book_with_footnote(self):
def test_book_with_footnote(self):
-
BOOK_TEXT =
"""<utwor>
+
book_text = b
"""<utwor>
<opowiadanie>
<akap><pe><slowo_obce>rose</slowo_obce> --- kind of a flower.</pe></akap>
<akap><pe><slowo_obce>rose</slowo_obce> --- kind of a flower.</pe></akap>
<opowiadanie>
<akap><pe><slowo_obce>rose</slowo_obce> --- kind of a flower.</pe></akap>
<akap><pe><slowo_obce>rose</slowo_obce> --- kind of a flower.</pe></akap>
@@
-28,7
+31,8
@@
class DictionaryTests(WLTestCase):
</opowiadanie></utwor>
"""
</opowiadanie></utwor>
"""
- book = Book.from_text_and_meta(ContentFile(BOOK_TEXT), self.book_info)
+ book = Book.from_text_and_meta(ContentFile(book_text), self.book_info)
+ self.client.login(username='test', password='test')
self.assertEqual(
len(self.client.get('/przypisy/').context['object_list']),
self.assertEqual(
len(self.client.get('/przypisy/').context['object_list']),
@@
-49,4
+53,3
@@
class DictionaryTests(WLTestCase):
len(self.client.get('/przypisy/?qual=techn.').context['object_list']),
1,
'There should be a note qualified with \'techn.\' qualifier.')
len(self.client.get('/przypisy/?qual=techn.').context['object_list']),
1,
'There should be a note qualified with \'techn.\' qualifier.')
-