Skip to content

Commit

Permalink
Add test_ok_when_multiple_custom_auth_backends test
Browse files Browse the repository at this point in the history
  • Loading branch information
apragacz committed Sep 20, 2022
1 parent 7d063e3 commit e384a8f
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,17 @@ def test_ok_when_multiple_auth_backends():
assert_error_codes_match(errors, [])


@override_settings(
AUTHENTICATION_BACKENDS=[
'tests.testapp.custom_auth_backends.backend.CustomAuthBackend',
'django.contrib.auth.backends.RemoteUserBackend',
],
)
def test_ok_when_multiple_custom_auth_backends():
errors = simulate_checks()
assert_error_codes_match(errors, [])


@override_rest_registration_settings({
'LOGIN_DEFAULT_SESSION_AUTHENTICATION_BACKEND': 'django.contrib.auth.backends.RemoteUserBackend', # noqa: E501
})
Expand Down
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions tests/testapps/custom_auth_backends/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class CustomAuthBackendsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'custom_auth_backends'
5 changes: 5 additions & 0 deletions tests/testapps/custom_auth_backends/backends.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.contrib.auth.backends import ModelBackend


class CustomAuthBackend(ModelBackend):
pass
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit e384a8f

Please sign in to comment.