|
@@ -5,12 +5,8 @@ from api import models |
|
|
|
|
|
|
|
|
class UserFactory(factory.DjangoModelFactory): |
|
|
class UserFactory(factory.DjangoModelFactory): |
|
|
class Meta: |
|
|
class Meta: |
|
|
model = models.User |
|
|
|
|
|
|
|
|
|
|
|
username = factory.Sequence(lambda n: 'username{0}'.format(n)) |
|
|
|
|
|
first_name = factory.Faker('first_name') |
|
|
|
|
|
last_name = factory.Faker('last_name') |
|
|
|
|
|
email = factory.LazyAttribute(lambda a: '{0}.{1}@oslab.fr'.format(a.first_name, a.last_name).lower()) |
|
|
|
|
|
|
|
|
model = models.LessPassUser |
|
|
|
|
|
email = factory.Sequence(lambda n: 'u{0}@lesspass.com'.format(n)) |
|
|
password = factory.PostGenerationMethodCall('set_password', 'password') |
|
|
password = factory.PostGenerationMethodCall('set_password', 'password') |
|
|
is_staff = False |
|
|
is_staff = False |
|
|
|
|
|
|
|
|