Skip to content

@konradhalas /gist:3504037
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
UserFactory with raw_password
class UserFactory(factory.Factory):
password = 'test'
@classmethod
def _prepare(cls, create, **kwargs):
password = kwargs.pop('password', None)
user = super(UserFactory, cls)._prepare(create, **kwargs)
if password:
user.raw_password = password
user.set_password(password)
if create:
user.save()
return user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.