def test_upload_image_bad_request(self):
    'Test uploading an invalid image'
    url = image_upload_url(self.recipe.id)
    res = self.client.post(url, {'image': 'notimage'}, format='multipart')
    self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)
Test uploading an invalid image
def test_upload_image_bad_request(self):
    
    url = image_upload_url(self.recipe.id)
    res = self.client.post(url, {'image': 'notimage'}, format='multipart')
    self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)