Add type hint for UserFactory (#5312)

Since factory-boy 3.3.1, we can type annotate factories:

https://github.com/FactoryBoy/factory_boy/pull/1059

Setting that up for the only factory of the project
This commit is contained in:
Bruno Alla 2024-08-21 11:35:20 +02:00 committed by GitHub
parent f28b74f2df
commit 69927387f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,7 +8,7 @@ from factory.django import DjangoModelFactory
from {{ cookiecutter.project_slug }}.users.models import User
class UserFactory(DjangoModelFactory):
class UserFactory(DjangoModelFactory[User]):
{%- if cookiecutter.username_type == "username" %}
username = Faker("user_name")
{%- endif %}