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

Fixed #20916 - Added support for a simple_login test client method. #2570

Closed
wants to merge 3 commits into from

Conversation

jfilipe
Copy link

@jfilipe jfilipe commented Apr 16, 2014

simple_login takes a user instance and logs you in as that user. You no longer have to manage user credentials in tests.

Ticket: 20916.

Todo:

  • Add docs

@@ -107,6 +109,9 @@ def setup_test_environment():
request._original_allowed_hosts = settings.ALLOWED_HOSTS
settings.ALLOWED_HOSTS = ['*']

auth._original_authentication_backends = settings.AUTHENTICATION_BACKENDS
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this patching happen in the simple_login() method? Otherwise, login() is affected as well which means it wouldn't reject invalid credentials Am I missing something?

@timgraham
Copy link
Member

Closing in absence of follow-up. Please send a new PR if you can update it, thanks.

@timgraham timgraham closed this Oct 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants