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:
Víðir Valberg Guðmundsson 2019-03-29 15:59:07 +01:00
parent 95dcba3fc3
commit 9d97a7184a

View file

@ -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')