aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2012-01-24 12:25:32 -0800
committerTom Christie2012-01-24 12:25:32 -0800
commitdf07616c6cd67c5f73b53a1d8f1cdd52d4f5594e (patch)
treee9d0e06f9498897c7fb7e199a7a91af26b09f11d
parent9ce864e63bd7e93e4602f687423f905749fbc0ea (diff)
parent54caf6d7ba8b53cb74774535f2ecd8584a9b2cfd (diff)
downloaddjango-rest-framework-df07616c6cd67c5f73b53a1d8f1cdd52d4f5594e.tar.bz2
Merge pull request #144 from btimby/master
Fix test_with_content_type_args to pass regardless of JSON library idiosyncracies
-rw-r--r--djangorestframework/tests/renderers.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/djangorestframework/tests/renderers.py b/djangorestframework/tests/renderers.py
index 84e4390b..77b5430f 100644
--- a/djangorestframework/tests/renderers.py
+++ b/djangorestframework/tests/renderers.py
@@ -1,3 +1,5 @@
+import re
+
from django.conf.urls.defaults import patterns, url
from django.test import TestCase
@@ -172,7 +174,7 @@ class RendererIntegrationTests(TestCase):
self.assertEquals(resp.status_code, DUMMYSTATUS)
_flat_repr = '{"foo": ["bar", "baz"]}'
-_indented_repr = '{\n "foo": [\n "bar", \n "baz"\n ]\n}'
+_indented_repr = '{\n "foo": [\n "bar",\n "baz"\n ]\n}'
class JSONRendererTests(TestCase):
@@ -187,6 +189,8 @@ class JSONRendererTests(TestCase):
obj = {'foo': ['bar', 'baz']}
renderer = JSONRenderer(None)
content = renderer.render(obj, 'application/json')
+ # Fix failing test case which depends on version of JSON library.
+ content = re.sub(' +\n', '\n', content)
self.assertEquals(content, _flat_repr)
def test_with_content_type_args(self):