@@ -164,6 +164,7 @@ def test_post_to_many_relationship_with_no_change(self):
164
164
}
165
165
response = self .client .post (url , data = json .dumps (request_data ), content_type = 'application/vnd.api+json' )
166
166
assert response .status_code == 204 , response .content .decode ()
167
+ assert len (response .rendered_content ) == 0 , response .rendered_content .decode ()
167
168
168
169
def test_post_to_many_relationship_with_change (self ):
169
170
url = '/entries/{}/relationships/comment_set' .format (self .first_entry .id )
@@ -207,6 +208,7 @@ def test_delete_to_many_relationship_with_no_change(self):
207
208
}
208
209
response = self .client .delete (url , data = json .dumps (request_data ), content_type = 'application/vnd.api+json' )
209
210
assert response .status_code == 204 , response .content .decode ()
211
+ assert len (response .rendered_content ) == 0 , response .rendered_content .decode ()
210
212
211
213
def test_delete_one_to_many_relationship_with_not_null_constraint (self ):
212
214
url = '/entries/{}/relationships/comment_set' .format (self .first_entry .id )
@@ -253,3 +255,15 @@ def _get_create_response(self, data, view):
253
255
user = self .create_user ('user' , 'pass' )
254
256
force_authenticate (request , user )
255
257
return view (request )
258
+
259
+
260
+ class TestModelViewSet (TestBase ):
261
+ def setUp (self ):
262
+ self .
author = Author .
objects .
create (
name = 'Super powerful superhero' ,
email = '[email protected] ' )
263
+ self .blog = Blog .objects .create (name = 'Some Blog' , tagline = "It's a blog" )
264
+
265
+ def test_no_content_response (self ):
266
+ url = '/blogs/{}' .format (self .blog .pk )
267
+ response = self .client .delete (url )
268
+ assert response .status_code == 204 , response .rendered_content .decode ()
269
+ assert len (response .rendered_content ) == 0 , response .rendered_content .decode ()
0 commit comments