-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OMERO.web:test login requests with JSON #6420
base: develop
Are you sure you want to change the base?
Conversation
Update the expected response message to include the reason Add a second integration test with a X-CSRFToken with empty value
Test empty and invalid CRSF token scenarios
Add test for missing CSRF cookie, empty and invalid CSRF tokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
login_json = json.loads(login_rsp.content) | ||
assert login_json['success'] | ||
event_context = login_json['eventContext'] | ||
login_rsp = django_client.post( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly comment to myself - this works because Client.post()
encodes the passed-in data
according to the given content_type
for application/json
and MULTIPART_CONTENT
; all other content_types
would cause data
to be passed as is.
👍 |
Depends on the improvements in ome/omero-web#607
This PR builds on top of #6419 to benefit from the refactoring and reduce conflicts as unnecessary imports are removed. Both
test_login_errors
andtest_login_example
are updated to test a login request posted either as form data or as JSON