from __future__ import absolute_import
from .. import models
import factory


class UserFactory(factory.django.DjangoModelFactory):
    username = factory.Sequence('user-{0}'.format)
    email = factory.Sequence('user-{0}@example.com'.format)

    class Meta:
        model = models.User

@@ -240,49 +240,171 @@
 at)%0A
-%0A    class Meta:%0A        model = models.User
+    password = factory.PostGenerationMethodCall('set_password', 'password')%0A%0A    class Meta:%0A        model = models.User%0A        django_get_or_create = ('username', )
 %0A

Set password in UserFactory