Tuned the tests so they are PY3 compilant.

This commit is contained in:
Honza Javorek 2013-09-25 16:31:23 +02:00
commit 6ed23fec7d

View file

@ -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):
'<a href="category/category.html">link</a>'))
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()