Commits

Carl Meyer  committed 514a972

Fix JSON serialization test.

  • Participants
  • Parent commits 3d08ae9

Comments (0)

Files changed (1)

File tests/tests.py

 from __future__ import with_statement
 
+import json
 import re
 
 from django.core import serializers
 
 
     def testSerializeJSON(self):
-        self.assertEquals(self.stream,
-                          '[{"pk": 1, "model": "tests.post", '
-                          '"fields": {"body": "replace this thing", '
-                          '"_body_rendered": "replacement thing", '
-                          '"title": "example post"}}]')
+        self.assertEquals(
+            json.loads(self.stream),
+            [
+                {
+                    "pk": 1,
+                    "model": "tests.post",
+                    "fields": {
+                        "body": "replace this thing",
+                        "_body_rendered": "replacement thing",
+                        "title": "example post",
+                        }
+                    }
+                ]
+            )
 
 
     def testDeserialize(self):