1 # -*- coding: utf-8 -*-
3 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
4 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 from zipfile import ZipFile
8 from nose.tools import *
9 from librarian import DirDocProvider
10 from librarian.parser import WLDocument
11 from tests.utils import get_fixture
15 epub = WLDocument.from_file(
16 get_fixture('text', 'asnyk_zbior.xml'),
17 provider=DirDocProvider(get_fixture('text', ''))
18 ).as_epub(flags=['without_fonts']).get_file()
21 # Check contributor list.
22 last = zipf.open('OPS/last.html')
23 tree = html.parse(last)
24 editors_attribution = False
25 for par in tree.findall("//p"):
26 if par.text.startswith(u'Opracowanie redakcyjne i przypisy:'):
27 editors_attribution = True
30 u'Opracowanie redakcyjne i przypisy: '
31 u'Adam Fikcyjny, Aleksandra Sekuła, Olga Sutkowska.')
32 assert_true(editors_attribution)