From b99c608ea10cabc97a6b251cdb6e81ef2a83bdcf Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sun, 9 Jun 2024 12:18:26 -0400 Subject: Refs #35402 -- Added tests for invalid usage of submodules in some settings. --- tests/auth_tests/test_models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/auth_tests/test_models.py') diff --git a/tests/auth_tests/test_models.py b/tests/auth_tests/test_models.py index 34f411f2f9..983424843c 100644 --- a/tests/auth_tests/test_models.py +++ b/tests/auth_tests/test_models.py @@ -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"] ) -- cgit v1.3