Avoided db queries in test_indentation_whitespace.
This commit is contained in:
parent
fc4b4fd585
commit
1a3bf236c0
|
@ -73,12 +73,8 @@ class JsonSerializerTestCase(SerializersTestBase, TestCase):
|
||||||
return ret_list
|
return ret_list
|
||||||
|
|
||||||
def test_indentation_whitespace(self):
|
def test_indentation_whitespace(self):
|
||||||
Score.objects.create(score=5.0)
|
|
||||||
Score.objects.create(score=6.0)
|
|
||||||
qset = Score.objects.all()
|
|
||||||
|
|
||||||
s = serializers.json.Serializer()
|
s = serializers.json.Serializer()
|
||||||
json_data = s.serialize(qset, indent=2)
|
json_data = s.serialize([Score(score=5.0), Score(score=6.0)], indent=2)
|
||||||
for line in json_data.splitlines():
|
for line in json_data.splitlines():
|
||||||
if re.search(r'.+,\s*$', line):
|
if re.search(r'.+,\s*$', line):
|
||||||
self.assertEqual(line, line.rstrip())
|
self.assertEqual(line, line.rstrip())
|
||||||
|
|
Loading…
Reference in New Issue