66from django .conf import settings
77
88from example .tests import TestBase
9- from example .tests .utils import dump_json , redump_json
9+ from example .tests .utils import dump_json , load_json
1010
1111
1212class ModelViewSetTests (TestBase ):
@@ -64,10 +64,9 @@ def test_key_in_list_result(self):
6464 }
6565 }
6666
67- content_dump = redump_json (response .content )
68- expected_dump = dump_json (expected )
67+ parsed_content = load_json (response .content )
6968
70- assert expected_dump == content_dump
69+ assert expected == parsed_content
7170
7271 def test_page_two_in_list_result (self ):
7372 """
@@ -104,10 +103,9 @@ def test_page_two_in_list_result(self):
104103 }
105104 }
106105
107- content_dump = redump_json (response .content )
108- expected_dump = dump_json (expected )
106+ parsed_content = load_json (response .content )
109107
110- assert expected_dump == content_dump
108+ assert expected == parsed_content
111109
112110 def test_page_range_in_list_result (self ):
113111 """
@@ -155,10 +153,9 @@ def test_page_range_in_list_result(self):
155153 }
156154 }
157155
158- content_dump = redump_json (response .content )
159- expected_dump = dump_json (expected )
156+ parsed_content = load_json (response .content )
160157
161- assert expected_dump == content_dump
158+ assert expected == parsed_content
162159
163160 def test_key_in_detail_result (self ):
164161 """
@@ -179,10 +176,9 @@ def test_key_in_detail_result(self):
179176 }
180177 }
181178
182- content_dump = redump_json (response .content )
183- expected_dump = dump_json (expected )
179+ parsed_content = load_json (response .content )
184180
185- assert expected_dump == content_dump
181+ assert expected == parsed_content
186182
187183 def test_patch_requires_id (self ):
188184 """
@@ -224,10 +220,9 @@ def test_key_in_post(self):
224220 content_type = 'application/vnd.api+json' ,
225221 data = dump_json (data ))
226222
227- content_dump = redump_json (response .content )
228- expected_dump = dump_json (data )
223+ parsed_content = load_json (response .content )
229224
230- assert expected_dump == content_dump
225+ assert data == parsed_content
231226
232227 # is it updated?
233228 self .assertEqual (
0 commit comments