Chore: Share the API client fixtures and build test users cheaply (#14199)

This commit is contained in:
Trenton H
2026-09-21 10:57:14 -07:00
committed by GitHub
parent 2d955e9697
commit 99ce6b5db3
44 changed files with 442 additions and 477 deletions
+4 -1
View File
@@ -78,7 +78,10 @@ class UserFactory(DjangoModelFactory[UserModelT]):
username = factory.Sequence(lambda n: f"user{n}")
is_staff = False
is_superuser = False
password = factory.django.Password("test")
# Hashing a real password costs about half a second per user, and no test
# authenticates with its password. None gives the unusable password
# create_user() gives.
password = factory.django.Password(None)
class Params:
superuser = factory.Trait(is_staff=True, is_superuser=True)