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.

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