Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Change expected response code for api delete method to 200 from 204 #159

Merged
merged 1 commit into from Mar 24, 2015

Conversation

bobsilverberg
Copy link
Contributor

This addresses, at least partially, issue #158.

My investigation indicates that the status code returned from a delete request against the API is now 200, whereas before it was 204. This fixes all of the errors that state AssertionError: Deletion of product Test Product xxx failed.

@peterbe or @camd can either of you confirm that this is expected, i.e., it is correct that we should be looking for a 200 response rather than a 204 response from a delete request now?

This does not address all of the HTTPError: 400 Client Error: BAD REQUEST that also showed up in the report [1]. I will need to investigate those separately.

[1] https://webqa-ci.mozilla.com/view/MozTrap/job/moztrap.stage.saucelabs/82/HTML_Report/

@bobsilverberg
Copy link
Contributor Author

FTR, with this change all of the tests pass for me locally against staging. It might be worth implementing this first, and then waiting to see if those 400 errors come back.

@peterbe
Copy link

peterbe commented Mar 24, 2015

r+

New tastypie returns a 204 for deletes but moztrap dislikes that and instead changes it to 200. The comments in the code explains it better. I'm still a bit uncertain why it was 204 before when mtapi.py clearly avoids that. Either way, the django 1.4 to django 1.5 upgrade was an enormous amount of work and the necessary upgrade to modern tastypie was huge so I must have lost track of some details.

Either way, moztrap prefers 200s on those deletes.

@bobsilverberg
Copy link
Contributor Author

Thanks @peterbe. I'm going to merge this in to restore coverage.

bobsilverberg added a commit that referenced this pull request Mar 24, 2015
Change expected response code for api delete method to 200 from 204
@bobsilverberg bobsilverberg merged commit 95006b6 into mozilla:master Mar 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants