Refs #35402 -- Added tests for invalid usage of submodules in some settings.

This commit is contained in:
Jacob Walls 2024-06-09 12:18:26 -04:00 committed by Sarah Boyce
parent 602fe961e6
commit b99c608ea1
2 changed files with 17 additions and 1 deletions

View file

@ -433,6 +433,13 @@ class UserWithPermTestCase(TestCase):
backend="invalid.backend.CustomModelBackend",
)
def test_invalid_backend_submodule(self):
with self.assertRaises(ImportError):
User.objects.with_perm(
"auth.test",
backend="json.tool",
)
@override_settings(
AUTHENTICATION_BACKENDS=["auth_tests.test_models.CustomModelBackend"]
)