jumpserver/apps/users/tests/base.py

24 lines
404 B
Python
Raw Normal View History

2016-08-23 14:19:39 +00:00
# ~*~ coding: utf-8 ~*~
from random import choice
import forgery_py
2016-08-24 09:14:21 +00:00
from users.models import User, UserGroup, init_all_models
2016-08-23 14:19:39 +00:00
def gen_username():
return forgery_py.internet.user_name(True)
def gen_email():
return forgery_py.internet.email_address()
def gen_name():
return forgery_py.name.full_name()
def get_role():
2016-08-24 09:14:21 +00:00
role = choice(dict(User.ROLE_CHOICES).keys())
2016-08-23 14:19:39 +00:00
return role