fixed code and test for Python3

This commit is contained in:
aniversarioperu
2014-09-04 07:02:27 +03:00
parent 62262be5f2
commit 1e82be8fd0
3 changed files with 12 additions and 3 deletions
+7 -1
View File
@@ -1,5 +1,8 @@
# -*- encoding: utf-8 -*-
import unittest
from six import PY3
from dataset.freeze.format.fcsv import value_to_str
from .sample_data import TEST_DATA
@@ -11,7 +14,10 @@ class FreezeTestCase(unittest.TestCase):
assert '2011-01-01T00:00:00' == value_to_str(TEST_DATA[0]['date'])
def test_value_to_str2(self):
assert 'hóla' == value_to_str(u'\u0068\u00f3\u006c\u0061')
if PY3:
assert 'hóla' == value_to_str('\u0068\u00f3\u006c\u0061')
else:
assert 'hóla' == value_to_str(u'\u0068\u00f3\u006c\u0061')
def test_value_to_str3(self):
assert '' == value_to_str(None)