Skip to content
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

Custom test client #431

Merged
merged 3 commits into from Jun 3, 2019

Conversation

Projects
None yet
4 participants
@singingwolfboy
Copy link
Contributor

commented May 30, 2019

Having a custom test client makes it easier to write automated tests using Flask-Login.

@maxcountryman maxcountryman requested a review from alanhamlett May 31, 2019

@maxcountryman

This comment has been minimized.

Copy link
Owner

commented May 31, 2019

This makes sense to me! 👍

@singingwolfboy singingwolfboy force-pushed the singingwolfboy:custom-test-client branch from 9bb2449 to 7780656 May 31, 2019

@singingwolfboy

This comment has been minimized.

Copy link
Contributor Author

commented May 31, 2019

Great! Do you have any feedback on the functionality or the documentation? I know that Flask-Login sets more values in the session cookie than user_id and _fresh, but those two were the easiest to handle, so I only included those. If you have a suggestion for how to handle the other values, I'd love to hear it! Alternatively, we can start with minimal functionality for now, and add more over time.

And are the docs clear? I always want to verify that my documentation is understandable to someone who didn't write the code. 😄

@coveralls

This comment has been minimized.

Copy link

commented May 31, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 28ea1b0 on singingwolfboy:custom-test-client into b07c159 on maxcountryman:master.

using the Flask-Login extension.
"""

def __init__(self, *args, **kwargs):

This comment has been minimized.

Copy link
@alanhamlett

alanhamlett Jun 3, 2019

Collaborator

This way is more explicit:
def __init__(self, user=None, fresh_login=True, *args, **kwargs):

I know the FlaskClient docs show using kwargs.pop so either is fine.

@alanhamlett alanhamlett merged commit 88cb9b9 into maxcountryman:master Jun 3, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 100.0%
Details

@singingwolfboy singingwolfboy deleted the singingwolfboy:custom-test-client branch Jun 3, 2019

@singingwolfboy

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

Great, thanks for merging! Any idea when there will be a new release of Flask-Login, so people can use this feature?

@alanhamlett

This comment has been minimized.

Copy link
Collaborator

commented Jun 3, 2019

@maxcountryman does the releases. Thanks for adding this, it will be very helpful when testing.

@singingwolfboy

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

Cool. Let's move this discussion over to issue #425.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.