custom user model that maintains id as pk

This commit is contained in:
Disco DeDisco
2026-01-30 15:04:47 -05:00
parent a734901b80
commit d724e03c3c
7 changed files with 48 additions and 5 deletions

View File

View File

@@ -0,0 +1,15 @@
from django.contrib import auth
from django.test import TestCase
from ..models import User
class UserModelTest(TestCase):
def test_model_is_configured_for_django_auth(self):
self.assertEqual(auth.get_user_model(), User)
def test_user_is_valid_with_email_only(self):
user = User(email="a@b.cde")
user.full_clean() # should not raise
def test_id_is_primary_key(self):
user = User(id="123")
self.assertEqual(user.pk, "123")