Fix a test dependent on json ordering.

This commit is contained in:
Marc Tamlyn 2014-05-22 15:05:19 +01:00
parent 48348782e6
commit 635acf42c5
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import json
import unittest import unittest
from django.contrib.postgres.fields import ArrayField from django.contrib.postgres.fields import ArrayField
@ -226,7 +227,7 @@ class TestSerialization(TestCase):
def test_dumping(self): def test_dumping(self):
instance = IntegerArrayModel(field=[1, 2]) instance = IntegerArrayModel(field=[1, 2])
data = serializers.serialize('json', [instance]) data = serializers.serialize('json', [instance])
self.assertEqual(data, self.test_data) self.assertEqual(json.loads(data), json.loads(self.test_data))
def test_loading(self): def test_loading(self):
instance = list(serializers.deserialize('json', self.test_data))[0].object instance = list(serializers.deserialize('json', self.test_data))[0].object