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

singingwolfboy
Copy link
Contributor

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

@maxcountryman
Copy link
Owner

This makes sense to me! 👍

@singingwolfboy
Copy link
Contributor Author

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
Copy link

coveralls 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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@singingwolfboy singingwolfboy deleted the custom-test-client branch June 3, 2019 18:27
@singingwolfboy
Copy link
Contributor Author

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

@alanhamlett
Copy link
Collaborator

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

@singingwolfboy
Copy link
Contributor Author

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

@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants