Permalink
Browse files

Fix seialize

  • Loading branch information...
1 parent cfca793 commit d4371d0fc857e3e836cb698a0411b546e2765635 @klen committed Oct 3, 2012
Showing with 3 additions and 7 deletions.
  1. +1 −5 adrest/utils/serializer.py
  2. +2 −2 tests/main/tests.py
View
6 adrest/utils/serializer.py
@@ -1,6 +1,5 @@
import abc
import collections
-import numbers
from datetime import datetime, date, time
from decimal import Decimal
@@ -41,9 +40,6 @@ def to_simple(self, value, **options):
if isinstance(value, Decimal):
return float(str(value))
- if isinstance(value, numbers.Number):
- return value
-
if isinstance(value, (datetime, date, time)):
return self.to_simple_datetime(value)
@@ -65,7 +61,7 @@ def to_simple(self, value, **options):
if isinstance(value, Model):
return self.to_simple_model(value, **options)
- return smart_unicode(value)
+ return value
@staticmethod
def to_simple_datetime(value):
View
4 tests/main/tests.py
@@ -37,8 +37,8 @@ def get(self, request):
response = test.dispatch(request)
self.assertContains(response, 'test')
- content = emitter.JSONSerializer().serialize([1, Decimal('3.4')])
- self.assertEqual(content, '[1, 3.4]')
+ content = emitter.JSONSerializer().serialize([1, Decimal('3.4'), None])
+ self.assertTrue('3.' in content and 'null' in content)
class MetaTest(TestCase):

0 comments on commit d4371d0

Please sign in to comment.