X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/16554e130cc1a138c2352279f9c9e08d87683997..a1eee7c004e2068b705bb4475633f76f2e38b4c4:/tests/test_html_fragments.py?ds=inline diff --git a/tests/test_html_fragments.py b/tests/test_html_fragments.py index 99bb62d..16057bc 100644 --- a/tests/test_html_fragments.py +++ b/tests/test_html_fragments.py @@ -3,9 +3,11 @@ # This file is part of Librarian, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +from __future__ import unicode_literals + from librarian.html import extract_fragments from nose.tools import * -from utils import get_fixture +from .utils import get_fixture def test_fragments(): @@ -14,7 +16,5 @@ def test_fragments(): closed_fragments, open_fragments = extract_fragments( get_fixture('text', 'asnyk_miedzy_nami_expected.html')) assert not open_fragments - fragments_text = u"\n\n".join(u"%s: %s\n%s" % (f.id, f.themes, f) - for f in closed_fragments.values()) - assert_equal(fragments_text, file(expected_output_file_path).read().decode('utf-8')) - + fragments_text = u"\n\n".join(u"%s: %s\n%s" % (f.id, f.themes, f) for f in sorted(closed_fragments.values(), key=lambda f: f.id)) + assert_equal(fragments_text, open(expected_output_file_path, 'rb').read().decode('utf-8'))