25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- import factory
-
- from api import models
-
-
- class UserFactory(factory.DjangoModelFactory):
- class Meta:
- model = models.LessPassUser
-
- email = factory.Sequence(lambda n: 'u{0}@lesspass.com'.format(n))
- password = factory.PostGenerationMethodCall('set_password', 'password')
- is_admin = False
-
-
- class AdminFactory(UserFactory):
- is_admin = True
-
-
- class PasswordFactory(factory.DjangoModelFactory):
- class Meta:
- model = models.Password
-
- user = factory.SubFactory(UserFactory)
- login = 'admin@oslab.fr'
- site = 'lesspass.com'
|