Merge pull request #381 from ad-m/patch-2

Add factories for model users.User
This commit is contained in:
Audrey Roy Greenfeld 2015-11-14 20:05:10 -08:00
commit 5079db3a4a

View File

@ -0,0 +1,11 @@
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', )