Make sure we do not get an IntegrityError because we are trying to create a new user with the same username as already created by another factory.
This commit is contained in:
parent
95dcba3fc3
commit
9d97a7184a
|
@ -5,6 +5,7 @@ from factory.django import DjangoModelFactory
|
|||
class UserFactory(DjangoModelFactory):
|
||||
class Meta:
|
||||
model = 'auth.User'
|
||||
django_get_or_create = ('username',)
|
||||
|
||||
username = factory.Faker('word')
|
||||
email = factory.Faker('ascii_email')
|
||||
|
|
Loading…
Reference in a new issue