diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 2e44253a..437d0228 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import six from datetime import datetime from sys import platform @@ -205,7 +206,10 @@ class TestPage(unittest.TestCase): 'link')) def test_intrasite_link(self): - article = type(b'_DummyArticle', (object,), {'url': 'article.html'}) + # type does not take unicode in PY2 and bytes in PY3, which in + # combination with unicode literals leads to following insane line: + cls_name = '_DummyArticle' if six.PY3 else b'_DummyArticle' + article = type(cls_name, (object,), {'url': 'article.html'}) args = self.page_kwargs.copy() args['settings'] = get_settings()