Skip to content

Commit 5cf9427

Browse files
committed
Drop b() helper from tests
This was only necessary for Python 2/3 compatibility
1 parent ecd53c4 commit 5cf9427

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

jsonview/tests.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
from __future__ import absolute_import, unicode_literals
2-
31
import json
4-
import sys
52
from unittest import SkipTest
63

74
import django
@@ -31,16 +28,6 @@ def eq_(a, b, msg=None):
3128
assert a == b, msg or '%r != %r' % (a, b)
3229

3330

34-
if sys.version < '3':
35-
def b(x):
36-
return x
37-
else:
38-
import codecs
39-
40-
def b(x):
41-
return codecs.latin_1_encode(x)[0]
42-
43-
4431
class CustomTestEncoder(DjangoJSONEncoder):
4532
def default(self, o):
4633
try:
@@ -255,7 +242,7 @@ def temp(req):
255242
res = temp(rf.get('/'))
256243
eq_(200, res.status_code)
257244
payload = json.dumps({'datetime': now}, cls=DjangoJSONEncoder)
258-
eq_(b(payload), res.content)
245+
eq_(payload, res.content)
259246

260247
@override_settings(JSON_OPTIONS={'cls': None})
261248
def test_datetime_no_serializer(self):

0 commit comments

Comments
 (0)