Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
|
- import factory
- from factory.django import DjangoModelFactory
-
- from api import models
-
-
- class UserFactory(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(DjangoModelFactory):
- class Meta:
- model = models.Password
-
- user = factory.SubFactory(UserFactory)
- login = "admin@oslab.fr"
- site = "lesspass.com"
-
-
- class EncryptedPasswordProfileFactory(DjangoModelFactory):
- class Meta:
- model = models.EncryptedPasswordProfile
-
- user = factory.SubFactory(UserFactory)
|