Avoided db queries in test_indentation_whitespace.

This commit is contained in:
Berker Peksag 2016-06-29 16:56:27 +03:00 committed by Tim Graham
parent fc4b4fd585
commit 1a3bf236c0
1 changed files with 1 additions and 5 deletions

View File

@ -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())