Skip to content

Instantly share code, notes, and snippets.

@rolo
rolo / factories.py
Created December 7, 2012 16:47 — forked from mbrochh/factories.py
Django UserFactory with factory_boy - using random instead of clock to avoid username clashes
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.