예제 #1
0
파일: user.py 프로젝트: leathe/byceps
def create_user(
    screen_name='Faith',
    *,
    user_id=None,
    created_at=None,
    email_address=None,
    email_address_verified=False,
    initialized=True,
):
    if not user_id:
        user_id = generate_uuid()

    if not created_at:
        created_at = datetime.utcnow()

    if not email_address:
        email_address = f'user{user_id}@example.com'

    user = user_creation_service.build_user(created_at, screen_name,
                                            email_address)
    user.id = user_id
    user.email_address_verified = email_address_verified
    user.initialized = initialized

    return user
예제 #2
0
파일: user.py 프로젝트: m-ober/byceps
def create_user(number, *, screen_name=None, email_address=None, enabled=True):
    if not screen_name:
        screen_name = 'User-{:d}'.format(number)

    if not email_address:
        email_address = 'user{:03d}@example.com'.format(number)

    user = User.create(screen_name, email_address, 'le_password')
    user.id = generate_uuid()
    user.enabled = enabled
    return user
예제 #3
0
파일: user.py 프로젝트: homeworkprod/byceps
def create_user(number, *, screen_name=None, email_address=None, enabled=True):
    if not screen_name:
        screen_name = 'User-{:d}'.format(number)

    if not email_address:
        email_address = 'user{:03d}@example.com'.format(number)

    user = user_service.build_user(screen_name, email_address)
    user.id = generate_uuid()
    user.enabled = enabled
    return user
예제 #4
0
def create_user(screen_name='Faith', *, email_address=None, enabled=True):
    user_id = generate_uuid()

    if not email_address:
        email_address = 'user{}@example.com'.format(user_id)

    user = user_creation_service.build_user(screen_name, email_address)
    user.id = user_id
    user.enabled = enabled

    return user
예제 #5
0
def create_user(number, *, screen_name=None, email_address=None, enabled=True):
    if not screen_name:
        screen_name = 'User-{:d}'.format(number)

    if not email_address:
        email_address = 'user{:03d}@example.com'.format(number)

    user = user_service.build_user(screen_name, email_address)
    user.id = generate_uuid()
    user.enabled = enabled
    return user
예제 #6
0
def create_avatar(creator, *, id=None, created_at=None, image_type=ImageType.jpeg):
    if id is None:
        id = generate_uuid()

    if created_at is None:
        created_at = datetime.utcnow()

    avatar = Avatar(creator, image_type)
    avatar.id = id
    avatar.created_at = created_at
    return avatar
예제 #7
0
def create_avatar(
    creator_id, *, id=None, created_at=None, image_type=ImageType.jpeg
):
    if id is None:
        id = generate_uuid()

    if created_at is None:
        created_at = datetime.utcnow()

    avatar = Avatar(creator_id, image_type)
    avatar.id = id
    avatar.created_at = created_at
    return avatar
예제 #8
0
파일: user.py 프로젝트: peerau/byceps
def create_user(screen_name='Faith',
                *,
                user_id=None,
                created_at=None,
                email_address=None,
                enabled=True):
    if not user_id:
        user_id = generate_uuid()

    if not created_at:
        created_at = datetime.utcnow()

    if not email_address:
        email_address = 'user{}@example.com'.format(user_id)

    user = user_creation_service.build_user(created_at, screen_name,
                                            email_address)
    user.id = user_id
    user.enabled = enabled

    return user