mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Tuned the tests so they are PY3 compilant.
This commit is contained in:
parent
7415d370e6
commit
6ed23fec7d
1 changed files with 5 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue