factories.py 490 Bytes
Newer Older
1
import factory
2
from django.conf import settings
3 4
from django.db.models.signals import post_save

5

6 7 8
@factory.django.mute_signals(post_save)
class UserFactory(factory.django.DjangoModelFactory):
    class Meta:
9
        model = settings.AUTH_USER_MODEL
10 11 12 13 14 15

    username = factory.Faker('user_name')
    first_name = factory.Faker('first_name')
    last_name = factory.Faker('last_name')
    email = factory.Faker('email')
    password = factory.PostGenerationMethodCall('set_password', 'totototo')