How to use the testfixtures.user.create_user_with_detail function in testfixtures

To help you get started, we’ve selected a few testfixtures examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github byceps / byceps / tests / helpers.py View on Github external
def create_user_with_detail(*args, **kwargs):
    user = _create_user_with_detail(*args, **kwargs)

    db.session.add(user)
    try:
        db.session.commit()
    except Exception as e:
        db.session.rollback()
        raise UserCreationFailed(e)

    return user
github byceps / byceps / tests / unit / services / user / test_models_birthday.py View on Github external
def test_days_until_next_birthday(today_text, expected):
    user = create_user_with_detail(date_of_birth=date(1994, 3, 18))

    with freeze_time(today_text):
        assert user.detail.days_until_next_birthday == expected
github byceps / byceps / tests / unit / services / user / test_models_birthday.py View on Github external
def test_is_birthday_today(today_text, expected):
    user = create_user_with_detail(date_of_birth=date(1994, 3, 18))

    with freeze_time(today_text):
        assert user.detail.is_birthday_today == expected
github byceps / byceps / tests / unit / services / orga / test_birthday_service.py View on Github external
def create_user(date_of_birth):
    return create_user_with_detail(date_of_birth=date_of_birth)
github byceps / byceps / tests / unit / services / user / test_models_age.py View on Github external
def test_age(today_text, expected):
    user = create_user_with_detail(date_of_birth=date(1994, 3, 18))

    with freeze_time(today_text):
        assert user.detail.age == expected