@@ -164,6 +164,7 @@ def test_post_to_many_relationship_with_no_change(self):
164164 }
165165 response = self .client .post (url , data = json .dumps (request_data ), content_type = 'application/vnd.api+json' )
166166 assert response .status_code == 204 , response .content .decode ()
167+ assert len (response .rendered_content ) == 0 , response .rendered_content .decode ()
167168
168169 def test_post_to_many_relationship_with_change (self ):
169170 url = '/entries/{}/relationships/comment_set' .format (self .first_entry .id )
@@ -207,6 +208,7 @@ def test_delete_to_many_relationship_with_no_change(self):
207208 }
208209 response = self .client .delete (url , data = json .dumps (request_data ), content_type = 'application/vnd.api+json' )
209210 assert response .status_code == 204 , response .content .decode ()
211+ assert len (response .rendered_content ) == 0 , response .rendered_content .decode ()
210212
211213 def test_delete_one_to_many_relationship_with_not_null_constraint (self ):
212214 url = '/entries/{}/relationships/comment_set' .format (self .first_entry .id )
@@ -253,3 +255,15 @@ def _get_create_response(self, data, view):
253255 user = self .create_user ('user' , 'pass' )
254256 force_authenticate (request , user )
255257 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