@with_save
def user(**kwargs):
    team_kw = kwargs.pop('team', None)
    defaults = dict(username='jdoe',
                    name='John Doe',
                    email='john@doe.com')
    defaults.update(kwargs)

    if 'slug' not in defaults:
        # This is silly, but it's probably "good enough"
        defaults['slug'] = ''.join(
            [c for c in defaults['username'].lower()
             if c.isalnum()]
        )

    user = User(**defaults)

    if team_kw is not None:
        t = team(**team_kw)
        user.teams.append(t)

    return user
Model maker for User
dataset/ETHPy150Open mozilla/standup/standup/tests/__init__.py/user