tests Module Documentation¶
Module contents¶
Submodules¶
tests.settings module¶
tests.test_backend module¶
-
tests.test_backend.
test_backend_applies_attributes_when_set
(monkeypatch, settings)[source]¶ If CAS_APPLY_ATTRIBUTES_TO_USER is set, make sure the attributes returned with the ticket are added to the User model.
-
tests.test_backend.
test_backend_authentication_create_user_with_id_and_attributes
(monkeypatch, django_user_model, settings)[source]¶ CAS_CREATE_USER_WITH_ID is True and the attributes are not provided.
Should raise ImproperlyConfigured exception
-
tests.test_backend.
test_backend_authentication_create_user_with_id_and_no_id_provided
(monkeypatch, django_user_model, settings)[source]¶ CAS_CREATE_USER_WITH_ID is True and the ‘id’ field is not in the attributes.
Should raise ImproperlyConfigured exception
-
tests.test_backend.
test_backend_authentication_create_user_with_id_and_user_exists
(monkeypatch, django_user_model, settings)[source]¶ If CAS_CREATE_USER_WITH_ID is True and and the User already exists, don’t create another user.
-
tests.test_backend.
test_backend_authentication_creates_a_user_with_id_attribute
(monkeypatch, django_user_model, settings)[source]¶ If CAS_CREATE_USER_WITH_ID is True and ‘id’ is in the attributes, use this field to get_or_create a User.
-
tests.test_backend.
test_backend_authentication_creating_a_user
(monkeypatch, django_user_model)[source]¶ Test the case where CAS authentication is creating a new user.
-
tests.test_backend.
test_backend_authentication_do_not_create_user
(monkeypatch, django_user_model, settings)[source]¶ Test the case where CAS authentication is not creating a new user.
-
tests.test_backend.
test_backend_does_not_apply_attributes_by_default
(monkeypatch)[source]¶ Test to make sure attributes returned from the provider are not assigned to the User model by default.
-
tests.test_backend.
test_backend_for_existing_user
(monkeypatch, django_user_model)[source]¶ Test the case where CAS authenticates an existing user.
-
tests.test_backend.
test_backend_for_existing_user_no_request
(monkeypatch, django_user_model)[source]¶ Test the case where CAS authenticates an existing user, but request argument is None.
-
tests.test_backend.
test_backend_for_failed_auth
(monkeypatch, django_user_model)[source]¶ Test CAS authentication failure.
-
tests.test_backend.
test_backend_user_can_authenticate
(monkeypatch, django_user_model)[source]¶ Test CAS authentication failure.
-
tests.test_backend.
test_backend_user_can_authenticate_with_cas_username_attribute
(monkeypatch, settings)[source]¶ Test CAS_USERNAME_ATTRIBUTE setting.
tests.test_commands module¶
Tests for the management commands
tests.test_middleware module¶
tests.test_signals module¶
-
tests.test_signals.
test_signal_not_fired_if_auth_fails
(monkeypatch, django_user_model)[source]¶ Test that the cas_user_authenticated signal is not fired when CAS authentication fails.
-
tests.test_signals.
test_signal_when_user_already_exists
(monkeypatch, django_user_model)[source]¶ Test that when CAS authentication creates a user, the signal is called with created = False
tests.test_utils module¶
tests.test_views module¶
-
tests.test_views.
test_callback_post_logout
(django_user_model, settings)[source]¶ Test that when logout is from a callback
-
tests.test_views.
test_login_authenticate_and_create_user
(monkeypatch, django_user_model, settings)[source]¶ Test the case where the login view authenticates a new user.
-
tests.test_views.
test_login_authenticate_do_not_create_user
(monkeypatch, django_user_model, settings)[source]¶ Test the case where the login view authenticates a user, but does not create a user based on the CAS_CREATE_USER setting.
-
tests.test_views.
test_login_no_ticket_stores_default_next
(settings)[source]¶ When there is no explicit next pointer, it gets stored in a cookie
-
tests.test_views.
test_login_no_ticket_stores_explicit_next
(settings)[source]¶ When there is an explicit next pointer, it gets stored in the cookie
-
tests.test_views.
test_login_post_logout
(django_user_model, settings)[source]¶ Test that when CAS authentication creates a user, the signal is called with created = True
-
tests.test_views.
test_login_proxy_callback
(monkeypatch, django_user_model, settings)[source]¶ Test the case where the login view has a pgtiou.
Test the case where the login view authenticates a new user and redirects them based on cookie.