Testlib request methods#5347
Merged
jburel merged 29 commits intoome:developfrom Aug 10, 2017
Merged
Conversation
jburel
reviewed
Jun 27, 2017
|
|
||
| :param django_client: Django test Client | ||
| :param request_url: The url to request | ||
| :param data: A dict of data to include as json content |
| def _post_response(django_client, request_url, data, status_code=403, | ||
| content_type=MULTIPART_CONTENT, **extra): | ||
| warnings.warn( | ||
| "This method is deprecated as of OMERO 5.4.0", DeprecationWarning) |
Member
There was a problem hiding this comment.
Maybe indicate the one to use in the message
Member
|
Would you mind temporarily excluding this so we can try to get #5349 in? |
Member
Author
|
@mtbc Added exclude label to description. |
Member
|
@will-moore could you remove the exclude label and fix the merge conflict |
Member
Author
|
Travis failure: "This job ran on our Trusty environment, which is gradually becoming our default Linux environment. You can add dist: precise in your .travis.yml file to continue using Precise." |
Member
|
@will-moore could you roll back your latest commit? |
02a3740 to
cea6fa3
Compare
Member
|
Thanks for updating message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Cleanup of
omeroweb.testlibDjango client request methods, based on https://trello.com/c/flvJ728g/31-web-api-tests-to-include-csrf.Previously we've had a number of
testlibmethods such as:These try to cover a matrix of:
These are replaced by a smaller number of methods.
For all POST, PUT & DELETE we first test without CSRF (check for 403 response) then with CSRF.
(This means that all the
test_api_*tests are now being tested for CSRF checks, as per trello card above).Testing this PR