mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-14 13:47:07 +03:00
12 lines
376 B
Python
12 lines
376 B
Python
import factory
|
|
|
|
|
|
class UserFactory(factory.django.DjangoModelFactory):
|
|
username = factory.Sequence(lambda n: 'user-{0}'.format(n))
|
|
email = factory.Sequence(lambda n: 'user-{0}@example.com'.format(n))
|
|
password = factory.PostGenerationMethodCall('set_password', 'password')
|
|
|
|
class Meta:
|
|
model = 'users.User'
|
|
django_get_or_create = ('username', )
|