summaryrefslogtreecommitdiff
path: root/tests/auth_tests/models/custom_user.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auth_tests/models/custom_user.py')
-rw-r--r--tests/auth_tests/models/custom_user.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auth_tests/models/custom_user.py b/tests/auth_tests/models/custom_user.py
index dac61f8e68..29dc42f645 100644
--- a/tests/auth_tests/models/custom_user.py
+++ b/tests/auth_tests/models/custom_user.py
@@ -143,3 +143,17 @@ with RemoveGroupsAndPermissions():
custom_objects = UserManager()
REQUIRED_FIELDS = AbstractUser.REQUIRED_FIELDS + ["date_of_birth"]
+
+
+class ErrorUserManager(BaseUserManager):
+ def get_by_natural_key(self, _):
+ raise TypeError
+
+ async def aget_by_natural_key(self, _):
+ raise TypeError
+
+
+with RemoveGroupsAndPermissions():
+
+ class ErrorAdminUser(AbstractUser):
+ custom_objects = ErrorUserManager()