ccdb-api/ccdb/users/tests/factories.py
Matthew Dillon 7ba937ef66 INITIAL
2016-01-19 15:10:09 -07:00

11 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', )