@@ -252,24 +252,17 @@ def test_put_patch_schema_instance_with_errors(self, mock_has_permission, mock_u
252252 )
253253 mock_update_schema_instance .assert_called_with (self .resource , fake_payload )
254254
255- @patch ("geonode.metadata.manager.metadata_manager.update_schema_instance" )
256255 @patch ("geonode.base.api.permissions.UserHasPerms.has_permission" , return_value = True )
257- def test_put_patch_schema_instance_with_bad_payload (self , mock_has_permission , mock_update_schema_instance ):
256+ def test_put_patch_schema_instance_with_bad_payload (self , mock_has_permission ):
258257 """
259258 Test the PUT method with an invalid json payload
260259 """
261260
262261 url = reverse ("metadata-schema_instance" , kwargs = {"pk" : self .resource .pk })
263262 fake_payload = "I_AM_BAD"
264263
265- # Set fake errors
266- errors = {"fake_error_1" : "Field 'title' is required" , "fake_error_2" : "Invalid value for 'type'" }
267- mock_update_schema_instance .return_value = errors
268-
269- response = self .client .put (url , data = fake_payload , format = "json" )
270- self .assertEqual (response .status_code , status .HTTP_400_BAD_REQUEST )
271-
272- mock_update_schema_instance .assert_called_with (self .resource , fake_payload )
264+ response = self .client .put (url , data = fake_payload , content_type = "application/json" )
265+ self .assertEqual (response .status_code , 400 )
273266
274267 @patch ("geonode.base.api.permissions.UserHasPerms.has_permission" , return_value = True )
275268 def test_resource_not_found (self , mock_has_permission ):
0 commit comments