Skip to content

Commit 6800ed9

Browse files
committed
Fix issue with Unicode characters
1 parent c29f0c5 commit 6800ed9

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

adapters/fields.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3+
from builtins import str
34
import datetime
45
import dateutil.parser
56
from decimal import Decimal

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
future
12
python-dateutil==2.6.0

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
url='https://github.com/alexei/python-adapters',
1717
download_url='https://github.com/alexei/python-adapters/archive/2.0.1.tar.gz', # noqa
1818
keywords=['adapter pattern'],
19-
install_requires=['python-dateutil>=2.6.0'],
19+
install_requires=[
20+
'future',
21+
'python-dateutil>=2.6.0',
22+
],
2023
)

tests/test_fields.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22

3+
from __future__ import unicode_literals
4+
35
import datetime
46
from decimal import Decimal
57
import unittest
@@ -16,6 +18,11 @@ def test_char_field(self):
1618
expected = 'Los Angeles'
1719
self.assertEqual(actual, expected)
1820

21+
def test_unicode_field(self):
22+
actual = adapters.CharField().adapt('Alexandru Mărășteanu')
23+
expected = 'Alexandru Mărășteanu'
24+
self.assertEqual(actual, expected)
25+
1926
def test_int_field(self):
2027
actual = adapters.IntField().adapt(123456)
2128
expected = 123456

0 commit comments

Comments
 (0)