def test_path(avatar_images_path, avatar_id, image_type, expected):
    user = create_user(1)

    avatar = create_avatar(user, id=avatar_id, image_type=image_type)

    with app_context() as app:
        app.config['PATH_USER_AVATAR_IMAGES'] = avatar_images_path
        assert avatar.path == expected
Example #2
0
def site(db):
    with app_context():
        with database_recreated(db):
            create_email_config()

            site = create_site()

            yield site
Example #3
0
def test_path(avatar_images_path, avatar_id, image_type, expected):
    user = create_user()

    avatar = create_avatar(user.id, id=avatar_id, image_type=image_type)

    with app_context() as app:
        app.config['PATH_USER_AVATAR_IMAGES'] = avatar_images_path
        assert avatar.path == expected
Example #4
0
def test_get_countries_contains_country(name, alpha2, alpha3):
    with app_context():
        countries = country_service.get_countries()

    country = find_by_name(countries, name)

    assert country is not None
    assert country.name == name
    assert country.alpha2 == alpha2
    assert country.alpha3 == alpha3
Example #5
0
def test_get_countries_contains_country(name, alpha2, alpha3):
    with app_context():
        countries = country_service.get_countries()

    country = find_by_name(countries, name)

    assert country is not None
    assert country.name == name
    assert country.alpha2 == alpha2
    assert country.alpha3 == alpha3
Example #6
0
def site(db):
    with app_context():
        with database_recreated(db):
            create_email_config()

            brand = create_brand()
            party = create_party(brand.id)

            site = create_site(party.id)

            yield site
Example #7
0
def test_get_country_names_contains_selected_items():
    with app_context():
        actual = country_service.get_country_names()

    some_expected = frozenset([
        'Belgien',
        'Dänemark',
        'Deutschland',
        'Vereinigtes Königreich Großbritannien und Nordirland',
        'Frankreich',
        'Niederlande',
        'Österreich',
        'Schweiz',
    ])

    assert frozenset(actual).issuperset(some_expected)
Example #8
0
def test_get_country_names_contains_selected_items():
    with app_context():
        actual = country_service.get_country_names()

    some_expected = frozenset(
        [
            "Belgien",
            "Dänemark",
            "Deutschland",
            "Vereinigtes Königreich Großbritannien und Nordirland",
            "Frankreich",
            "Niederlande",
            "Österreich",
            "Schweiz",
        ]
    )

    assert frozenset(actual).issuperset(some_expected)
Example #9
0
def test_get_country_names_contains_no_duplicates():
    with app_context():
        actual = country_service.get_country_names()

    assert len(actual) == len(set(actual))
Example #10
0
def test_get_country_names_contains_no_duplicates():
    with app_context():
        actual = country_service.get_country_names()

    assert len(actual) == len(set(actual))