Skip to content

Instantly share code, notes, and snippets.

Avatar

Rolo rolo

View GitHub Profile
@rolo
rolo / factories.py
Created Dec 7, 2012 — forked from mbrochh/factories.py
Django UserFactory with factory_boy - using random instead of clock to avoid username clashes
View factories.py
import random
from django.contrib.auth.models import User
from factory import Factory, LazyAttribute, Sequence
class UserFactory(Factory):
"""
Creates a new ``User`` object.
Username will be a random 30 character md5 value.
You can’t perform that action at this time.