You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

factories.py 563 B

12345678910111213141516171819202122232425
  1. import factory
  2. from api import models
  3. class UserFactory(factory.DjangoModelFactory):
  4. class Meta:
  5. model = models.LessPassUser
  6. email = factory.Sequence(lambda n: 'u{0}@lesspass.com'.format(n))
  7. password = factory.PostGenerationMethodCall('set_password', 'password')
  8. is_admin = False
  9. class AdminFactory(UserFactory):
  10. is_admin = True
  11. class PasswordFactory(factory.DjangoModelFactory):
  12. class Meta:
  13. model = models.Password
  14. user = factory.SubFactory(UserFactory)
  15. login = 'admin@oslab.fr'
  16. site = 'lesspass.com'