~homeworkprod/byceps

f011875188c3e658cc77c63272d621c95b1fed59 — Jochen Kupperschmidt 1 year, 4 months ago 1fd2bb9
Rename "party app" to "site app" in tests
33 files changed, 106 insertions(+), 106 deletions(-)

M config/test_admin.py
R config/{test_party.py => test_site.py}
M tests/base.py
M tests/conftest.py
M tests/helpers.py
M tests/integration/blueprints/authentication/test_views_password_update.py
M tests/integration/blueprints/authentication/test_views_password_update_form.py
M tests/integration/blueprints/site/board/conftest.py
M tests/integration/blueprints/site/board/test_posting_hide_unhide.py
M tests/integration/blueprints/site/board/test_topic_hide_unhide.py
M tests/integration/blueprints/site/board/test_topic_lock_unlock.py
M tests/integration/blueprints/site/board/test_topic_move.py
M tests/integration/blueprints/site/board/test_topic_pin_unpin.py
M tests/integration/blueprints/site/shop/order/test_views.py
M tests/integration/blueprints/site/shop/orders/test_views.py
M tests/integration/blueprints/site/ticketing/test_views_mytickets.py
M tests/integration/blueprints/site/user/test_views_user_profile.py
M tests/integration/blueprints/site/user_message/test_send.py
M tests/integration/blueprints/test_homepage.py
M tests/integration/blueprints/user/test_views_create.py
M tests/integration/blueprints/user/test_views_current_user.py
M tests/integration/blueprints/user/test_views_current_user_json.py
M tests/integration/blueprints/user/test_views_email_address_confirmation.py
M tests/integration/services/authentication/test_update_password_hash.py
M tests/integration/services/authorization/test_service.py
M tests/integration/services/country/test_service.py
M tests/integration/services/shop/order/email/test_email_on_order_canceled.py
M tests/integration/services/shop/order/email/test_email_on_order_paid.py
M tests/integration/services/shop/order/email/test_email_on_order_placed.py
M tests/integration/services/shop/order/models/test_order_total_amount.py
M tests/integration/services/user/test_find_user.py
M tests/integration/services/user/test_update_user_details.py
M tests/integration/services/user_badge/test_service_awarding.py
M config/test_admin.py => config/test_admin.py +1 -1
@@ 1,4 1,4 @@
# an admin site configuration file to be used in tests
# an admin app configuration file to be used in tests

SECRET_KEY = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
SERVER_NAME = 'admin.acmecon.test'

R config/test_party.py => config/test_site.py +1 -1
@@ 1,4 1,4 @@
# a party site configuration file to be used in tests
# a site app configuration file to be used in tests

SECRET_KEY = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
SERVER_NAME = 'www.acmecon.test'

M tests/base.py => tests/base.py +3 -3
@@ 13,7 13,7 @@ from byceps.application import create_app


_CONFIG_PATH = Path('../config')
CONFIG_FILENAME_TEST_PARTY = _CONFIG_PATH / 'test_party.py'
CONFIG_FILENAME_TEST_SITE = _CONFIG_PATH / 'test_site.py'
CONFIG_FILENAME_TEST_ADMIN = _CONFIG_PATH / 'test_admin.py'




@@ 21,5 21,5 @@ def create_admin_app(config_overrides: Optional[Dict[str, Any]] = None):
    return create_app(CONFIG_FILENAME_TEST_ADMIN, config_overrides)


def create_party_app(config_overrides: Optional[Dict[str, Any]] = None):
    return create_app(CONFIG_FILENAME_TEST_PARTY, config_overrides)
def create_site_app(config_overrides: Optional[Dict[str, Any]] = None):
    return create_app(CONFIG_FILENAME_TEST_SITE, config_overrides)

M tests/conftest.py => tests/conftest.py +7 -7
@@ 19,7 19,7 @@ from byceps.services.user import (
    service as user_service,
)

from tests.base import create_admin_app, create_party_app
from tests.base import create_admin_app, create_site_app
from tests.database import set_up_database, tear_down_database
from tests.helpers import (
    create_brand,


@@ 63,21 63,21 @@ def admin_client(admin_app):


@pytest.fixture(scope='session')
def make_party_app(admin_app, data_path):
    """Provide a party web application."""
def make_site_app(admin_app, data_path):
    """Provide a site web application."""

    def _wrapper(**config_overrides):
        if CONFIG_PATH_DATA_KEY not in config_overrides:
            config_overrides[CONFIG_PATH_DATA_KEY] = data_path
        return create_party_app(config_overrides)
        return create_site_app(config_overrides)

    return _wrapper


@pytest.fixture(scope='session')
def party_app(make_party_app):
    """Provide a party web application."""
    app = make_party_app()
def site_app(make_site_app):
    """Provide a site web application."""
    app = make_site_app()
    with app.app_context():
        yield app


M tests/helpers.py => tests/helpers.py +2 -2
@@ 25,14 25,14 @@ from testfixtures.user import (
    create_user_with_detail as _create_user_with_detail,
)

from .base import CONFIG_FILENAME_TEST_PARTY
from .base import CONFIG_FILENAME_TEST_SITE


DEFAULT_EMAIL_CONFIG_ID = 'email-config-1'


@contextmanager
def app_context(*, config_filename=CONFIG_FILENAME_TEST_PARTY):
def app_context(*, config_filename=CONFIG_FILENAME_TEST_SITE):
    app = create_app(config_filename)

    with app.app_context():

M tests/integration/blueprints/authentication/test_views_password_update.py => tests/integration/blueprints/authentication/test_views_password_update.py +4 -4
@@ 17,7 17,7 @@ def user(make_user):
    return make_user('PasswordUpdater')


def test_when_logged_in_endpoint_is_available(party_app, site, user):
def test_when_logged_in_endpoint_is_available(site_app, site, user):
    old_password = 'LekkerBratworsten'
    new_password = 'EvenMoreSecure!!1'



@@ 41,7 41,7 @@ def test_when_logged_in_endpoint_is_available(party_app, site, user):
        'new_password_confirmation': new_password,
    }

    response = send_request(party_app, form_data, user_id=user.id)
    response = send_request(site_app, form_data, user_id=user.id)

    assert response.status_code == 302
    assert response.headers.get('Location') == 'http://www.acmecon.test/authentication/login'


@@ 57,10 57,10 @@ def test_when_logged_in_endpoint_is_available(party_app, site, user):
    assert session_token_after is None


def test_when_not_logged_in_endpoint_is_unavailable(party_app, site):
def test_when_not_logged_in_endpoint_is_unavailable(site_app, site):
    form_data = {}

    response = send_request(party_app, form_data)
    response = send_request(site_app, form_data)

    assert response.status_code == 404


M tests/integration/blueprints/authentication/test_views_password_update_form.py => tests/integration/blueprints/authentication/test_views_password_update_form.py +4 -4
@@ 6,16 6,16 @@
from tests.helpers import http_client, login_user


def test_when_logged_in_form_is_available(party_app, site, user):
def test_when_logged_in_form_is_available(site_app, site, user):
    login_user(user.id)

    response = send_request(party_app, user_id=user.id)
    response = send_request(site_app, user_id=user.id)

    assert response.status_code == 200


def test_when_not_logged_in_form_is_unavailable(party_app, site):
    response = send_request(party_app)
def test_when_not_logged_in_form_is_unavailable(site_app, site):
    response = send_request(site_app)

    assert response.status_code == 404


M tests/integration/blueprints/site/board/conftest.py => tests/integration/blueprints/site/board/conftest.py +2 -2
@@ 92,6 92,6 @@ def moderator(make_user):


@pytest.fixture(scope='session')
def moderator_client(party_app, moderator):
    with http_client(party_app, user_id=moderator.id) as client:
def moderator_client(site_app, moderator):
    with http_client(site_app, user_id=moderator.id) as client:
        yield client

M tests/integration/blueprints/site/board/test_posting_hide_unhide.py => tests/integration/blueprints/site/board/test_posting_hide_unhide.py +2 -2
@@ 10,7 10,7 @@ from byceps.services.board import (
from .helpers import find_posting


def test_hide_posting(party_app, moderator, moderator_client, posting):
def test_hide_posting(site_app, moderator, moderator_client, posting):
    posting_before = posting

    assert_posting_is_not_hidden(posting_before)


@@ 23,7 23,7 @@ def test_hide_posting(party_app, moderator, moderator_client, posting):
    assert_posting_is_hidden(posting_afterwards, moderator.id)


def test_unhide_posting(party_app, moderator, moderator_client, posting):
def test_unhide_posting(site_app, moderator, moderator_client, posting):
    posting_before = posting

    board_posting_command_service.hide_posting(posting_before.id, moderator.id)

M tests/integration/blueprints/site/board/test_topic_hide_unhide.py => tests/integration/blueprints/site/board/test_topic_hide_unhide.py +2 -2
@@ 10,7 10,7 @@ from byceps.services.board import (
from .helpers import find_topic


def test_hide_topic(party_app, moderator, moderator_client, topic):
def test_hide_topic(site_app, moderator, moderator_client, topic):
    topic_before = topic

    assert_topic_is_not_hidden(topic_before)


@@ 23,7 23,7 @@ def test_hide_topic(party_app, moderator, moderator_client, topic):
    assert_topic_is_hidden(topic_afterwards, moderator.id)


def test_unhide_topic(party_app, moderator, moderator_client, topic):
def test_unhide_topic(site_app, moderator, moderator_client, topic):
    topic_before = topic

    board_topic_command_service.hide_topic(topic_before.id, moderator.id)

M tests/integration/blueprints/site/board/test_topic_lock_unlock.py => tests/integration/blueprints/site/board/test_topic_lock_unlock.py +2 -2
@@ 10,7 10,7 @@ from byceps.services.board import (
from .helpers import find_topic


def test_lock_topic(party_app, moderator, moderator_client, topic):
def test_lock_topic(site_app, moderator, moderator_client, topic):
    topic_before = topic

    assert_topic_is_not_locked(topic_before)


@@ 23,7 23,7 @@ def test_lock_topic(party_app, moderator, moderator_client, topic):
    assert_topic_is_locked(topic_afterwards, moderator.id)


def test_unlock_topic(party_app, moderator, moderator_client, topic):
def test_unlock_topic(site_app, moderator, moderator_client, topic):
    topic_before = topic

    board_topic_command_service.lock_topic(topic_before.id, moderator.id)

M tests/integration/blueprints/site/board/test_topic_move.py => tests/integration/blueprints/site/board/test_topic_move.py +1 -1
@@ 7,7 7,7 @@ from .helpers import create_topic, find_topic


def test_move_topic(
    party_app,
    site_app,
    board_poster,
    moderator,
    moderator_client,

M tests/integration/blueprints/site/board/test_topic_pin_unpin.py => tests/integration/blueprints/site/board/test_topic_pin_unpin.py +2 -2
@@ 10,7 10,7 @@ from byceps.services.board import (
from .helpers import find_topic


def test_pin_topic(party_app, moderator, moderator_client, topic):
def test_pin_topic(site_app, moderator, moderator_client, topic):
    topic_before = topic

    assert_topic_is_not_pinned(topic_before)


@@ 23,7 23,7 @@ def test_pin_topic(party_app, moderator, moderator_client, topic):
    assert_topic_is_pinned(topic_afterwards, moderator.id)


def test_unpin_topic(party_app, moderator, moderator_client, topic):
def test_unpin_topic(site_app, moderator, moderator_client, topic):
    topic_before = topic
    board_topic_command_service.pin_topic(topic_before.id, moderator.id)


M tests/integration/blueprints/site/shop/order/test_views.py => tests/integration/blueprints/site/shop/order/test_views.py +2 -2
@@ 78,8 78,8 @@ def site(brand, storefront):


@pytest.fixture
def site_app(site, make_party_app):
    app = make_party_app(SITE_ID=site.id)
def site_app(site, make_site_app):
    app = make_site_app(SITE_ID=site.id)
    with app.app_context():
        yield app


M tests/integration/blueprints/site/shop/orders/test_views.py => tests/integration/blueprints/site/shop/orders/test_views.py +4 -4
@@ 108,15 108,15 @@ def site2(brand, storefront2):


@pytest.fixture
def site1_app(site1, make_party_app):
    app = make_party_app(SITE_ID=site1.id)
def site1_app(site1, make_site_app):
    app = make_site_app(SITE_ID=site1.id)
    with app.app_context():
        yield app


@pytest.fixture
def site2_app(site2, make_party_app):
    app = make_party_app(SITE_ID=site2.id)
def site2_app(site2, make_site_app):
    app = make_site_app(SITE_ID=site2.id)
    with app.app_context():
        yield app


M tests/integration/blueprints/site/ticketing/test_views_mytickets.py => tests/integration/blueprints/site/ticketing/test_views_mytickets.py +4 -4
@@ 8,17 8,17 @@ import pytest
from tests.helpers import http_client, login_user


def test_when_logged_in(party_app, site, user):
def test_when_logged_in(site_app, site, user):
    login_user(user.id)

    response = send_request(party_app, user_id=user.id)
    response = send_request(site_app, user_id=user.id)

    assert response.status_code == 200
    assert response.mimetype == 'text/html'


def test_when_not_logged_in(party_app, site):
    response = send_request(party_app)
def test_when_not_logged_in(site_app, site):
    response = send_request(site_app)

    assert response.status_code == 302
    assert 'Location' in response.headers

M tests/integration/blueprints/site/user/test_views_user_profile.py => tests/integration/blueprints/site/user/test_views_user_profile.py +10 -10
@@ 6,37 6,37 @@
from tests.helpers import http_client


def test_view_profile_of_existing_user(party_app, site, user):
    response = request_profile(party_app, user.id)
def test_view_profile_of_existing_user(site_app, site, user):
    response = request_profile(site_app, user.id)

    assert response.status_code == 200
    assert response.mimetype == 'text/html'


def test_view_profile_of_uninitialized_user(
    party_app, site, uninitialized_user
    site_app, site, uninitialized_user
):
    response = request_profile(party_app, uninitialized_user.id)
    response = request_profile(site_app, uninitialized_user.id)

    assert response.status_code == 404


def test_view_profile_of_suspended_user(party_app, site, suspended_user):
    response = request_profile(party_app, suspended_user.id)
def test_view_profile_of_suspended_user(site_app, site, suspended_user):
    response = request_profile(site_app, suspended_user.id)

    assert response.status_code == 404


def test_view_profile_of_deleted_user(party_app, site, deleted_user):
    response = request_profile(party_app, deleted_user.id)
def test_view_profile_of_deleted_user(site_app, site, deleted_user):
    response = request_profile(site_app, deleted_user.id)

    assert response.status_code == 404


def test_view_profile_of_unknown_user(party_app, site):
def test_view_profile_of_unknown_user(site_app, site):
    unknown_user_id = '00000000-0000-0000-0000-000000000000'

    response = request_profile(party_app, unknown_user_id)
    response = request_profile(site_app, unknown_user_id)

    assert response.status_code == 404


M tests/integration/blueprints/site/user_message/test_send.py => tests/integration/blueprints/site/user_message/test_send.py +4 -4
@@ 50,15 50,15 @@ def site2(brand, make_email_config):


@pytest.fixture
def site1_app(site1, make_party_app):
    app = make_party_app(SITE_ID=site1.id)
def site1_app(site1, make_site_app):
    app = make_site_app(SITE_ID=site1.id)
    with app.app_context():
        yield app


@pytest.fixture
def site2_app(site2, make_party_app):
    app = make_party_app(SITE_ID=site2.id)
def site2_app(site2, make_site_app):
    app = make_site_app(SITE_ID=site2.id)
    with app.app_context():
        yield app


M tests/integration/blueprints/test_homepage.py => tests/integration/blueprints/test_homepage.py +2 -2
@@ 8,8 8,8 @@ import pytest
from tests.helpers import http_client


def test_homepage(party_app, site):
    with http_client(party_app) as client:
def test_homepage(site_app, site):
    with http_client(site_app) as client:
        response = client.get('/')

    # By default, nothing is mounted on `/`, but at least check that

M tests/integration/blueprints/user/test_views_create.py => tests/integration/blueprints/user/test_views_create.py +4 -4
@@ 99,7 99,7 @@ def newsletter_list(brand):
@patch('byceps.email.send')
def test_create(
    send_email_mock,
    party_app,
    site_app,
    brand,
    site,
    terms_version,


@@ 123,7 123,7 @@ def test_create(
        'subscribe_to_newsletter': 'y',
    }

    response = send_request(party_app, form_data)
    response = send_request(site_app, form_data)
    assert response.status_code == 302

    user_count_afterwards = get_user_count()


@@ 188,7 188,7 @@ bitte bestätige deine E-Mail-Adresse, indem du diese URL abrufst: https://www.a
@patch('byceps.email.send')
def test_create_without_newsletter_subscription(
    send_email_mock,
    party_app,
    site_app,
    brand,
    site,
    terms_version,


@@ 209,7 209,7 @@ def test_create_without_newsletter_subscription(
        'subscribe_to_newsletter': '',
    }

    response = send_request(party_app, form_data)
    response = send_request(site_app, form_data)
    assert response.status_code == 302

    user = find_user(screen_name)

M tests/integration/blueprints/user/test_views_current_user.py => tests/integration/blueprints/user/test_views_current_user.py +4 -4
@@ 6,17 6,17 @@
from tests.helpers import http_client, login_user


def test_when_logged_in(party_app, site, user):
def test_when_logged_in(site_app, site, user):
    login_user(user.id)

    response = send_request(party_app, user_id=user.id)
    response = send_request(site_app, user_id=user.id)

    assert response.status_code == 200
    assert response.mimetype == 'text/html'


def test_when_not_logged_in(party_app, site):
    response = send_request(party_app)
def test_when_not_logged_in(site_app, site):
    response = send_request(site_app)

    assert response.status_code == 302
    assert 'Location' in response.headers

M tests/integration/blueprints/user/test_views_current_user_json.py => tests/integration/blueprints/user/test_views_current_user_json.py +4 -4
@@ 9,10 9,10 @@ from tests.helpers import http_client, login_user
CONTENT_TYPE_JSON = 'application/json'


def test_when_logged_in(party_app, site, user):
def test_when_logged_in(site_app, site, user):
    login_user(user.id)

    response = send_request(party_app, user_id=user.id)
    response = send_request(site_app, user_id=user.id)

    assert response.status_code == 200
    assert response.content_type == CONTENT_TYPE_JSON


@@ 24,8 24,8 @@ def test_when_logged_in(party_app, site, user):
    assert response_data['avatar_url'] is None


def test_when_not_logged_in(party_app, site):
    response = send_request(party_app)
def test_when_not_logged_in(site_app, site):
    response = send_request(site_app)

    assert response.status_code == 403
    assert response.get_data() == b''

M tests/integration/blueprints/user/test_views_email_address_confirmation.py => tests/integration/blueprints/user/test_views_email_address_confirmation.py +4 -4
@@ 35,7 35,7 @@ def role(admin_app, site, user1, user2):
    authorization_service.delete_role(role.id)


def test_confirm_email_address_with_valid_token(party_app, user1, role):
def test_confirm_email_address_with_valid_token(site_app, user1, role):
    user = user1

    verification_token = create_confirmation_token(user.id)


@@ 44,7 44,7 @@ def test_confirm_email_address_with_valid_token(party_app, user1, role):

    # -------------------------------- #

    response = confirm(party_app, verification_token)
    response = confirm(site_app, verification_token)

    # -------------------------------- #



@@ 53,7 53,7 @@ def test_confirm_email_address_with_valid_token(party_app, user1, role):
    assert get_role_ids(user.id) == {'board_user'}


def test_confirm_email_address_with_unknown_token(party_app, site, user2, role):
def test_confirm_email_address_with_unknown_token(site_app, site, user2, role):
    user = user2

    verification_token = create_confirmation_token(user.id)


@@ 61,7 61,7 @@ def test_confirm_email_address_with_unknown_token(party_app, site, user2, role):

    # -------------------------------- #

    response = confirm(party_app, verification_token)
    response = confirm(site_app, verification_token)

    # -------------------------------- #


M tests/integration/services/authentication/test_update_password_hash.py => tests/integration/services/authentication/test_update_password_hash.py +1 -1
@@ 8,7 8,7 @@ from byceps.services.authentication.password import service as password_service
from byceps.services.user import event_service


def test_update_password_hash(party_app, admin_user, make_user):
def test_update_password_hash(site_app, admin_user, make_user):
    admin_id = admin_user.id
    user_id = make_user('PasswordHashUpdater').id


M tests/integration/services/authorization/test_service.py => tests/integration/services/authorization/test_service.py +2 -2
@@ 13,13 13,13 @@ from tests.helpers import (
)


def test_get_permission_ids_for_user_without_user_permissions(party_app, user):
def test_get_permission_ids_for_user_without_user_permissions(site_app, user):
    actual = authorization_service.get_permission_ids_for_user(user.id)
    assert actual == frozenset()


def test_get_permission_ids_for_user_with_user_permissions(
    party_app, user, permissions
    site_app, user, permissions
):
    actual = authorization_service.get_permission_ids_for_user(user.id)
    assert actual == {

M tests/integration/services/country/test_service.py => tests/integration/services/country/test_service.py +3 -3
@@ 12,7 12,7 @@ from byceps.services.country import service as country_service
    ('Deutschland', 'DE', 'DEU'),
    ('Österreich' , 'AT', 'AUT'),
])
def test_get_countries_contains_country(party_app, name, alpha2, alpha3):
def test_get_countries_contains_country(site_app, name, alpha2, alpha3):
    countries = country_service.get_countries()

    country = find_by_name(countries, name)


@@ 23,7 23,7 @@ def test_get_countries_contains_country(party_app, name, alpha2, alpha3):
    assert country.alpha3 == alpha3


def test_get_country_names_contains_selected_items(party_app):
def test_get_country_names_contains_selected_items(site_app):
    actual = country_service.get_country_names()

    some_expected = frozenset([


@@ 40,7 40,7 @@ def test_get_country_names_contains_selected_items(party_app):
    assert frozenset(actual).issuperset(some_expected)


def test_get_country_names_contains_no_duplicates(party_app):
def test_get_country_names_contains_no_duplicates(site_app):
    actual = country_service.get_country_names()

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

M tests/integration/services/shop/order/email/test_email_on_order_canceled.py => tests/integration/services/shop/order/email/test_email_on_order_canceled.py +2 -2
@@ 75,9 75,9 @@ def order(storefront, customer, order_admin):

@patch('byceps.email.send')
def test_email_on_order_canceled(
    send_email_mock, party_app, customer, order_admin, order
    send_email_mock, site_app, customer, order_admin, order
):
    app = party_app
    app = site_app

    reason = 'Du hast nicht rechtzeitig bezahlt.'
    order_service.cancel_order(order.id, order_admin.id, reason)

M tests/integration/services/shop/order/email/test_email_on_order_paid.py => tests/integration/services/shop/order/email/test_email_on_order_paid.py +2 -2
@@ 76,9 76,9 @@ def order(storefront, customer, order_admin):

@patch('byceps.email.send')
def test_email_on_order_paid(
    send_email_mock, party_app, customer, order_admin, order
    send_email_mock, site_app, customer, order_admin, order
):
    app = party_app
    app = site_app

    order_service.mark_order_as_paid(
        order.id, PaymentMethod.bank_transfer, order_admin.id

M tests/integration/services/shop/order/email/test_email_on_order_placed.py => tests/integration/services/shop/order/email/test_email_on_order_placed.py +2 -2
@@ 122,8 122,8 @@ def order(storefront, article1, article2, customer, order_admin):


@patch('byceps.email.send')
def test_email_on_order_placed(send_email_mock, party_app, customer, order):
    app = party_app
def test_email_on_order_placed(send_email_mock, site_app, customer, order):
    app = site_app

    with current_user_set(app, customer), app.app_context():
        order_email_service.send_email_for_incoming_order_to_orderer(order.id)

M tests/integration/services/shop/order/models/test_order_total_amount.py => tests/integration/services/shop/order/models/test_order_total_amount.py +3 -3
@@ 47,7 47,7 @@ def orderer(make_user_with_detail):
    return create_orderer(make_user_with_detail('TotalAmountOrderer'))


def test_without_any_items(party_app, storefront, orderer):
def test_without_any_items(site_app, storefront, orderer):
    order = place_order(storefront.id, orderer, [])

    assert order.total_amount == Decimal('0.00')


@@ 55,7 55,7 @@ def test_without_any_items(party_app, storefront, orderer):
    order_service.delete_order(order.id)


def test_with_single_item(party_app, storefront, orderer, article1):
def test_with_single_item(site_app, storefront, orderer, article1):
    order = place_order(storefront.id, orderer, [
        (article1, 1),
    ])


@@ 66,7 66,7 @@ def test_with_single_item(party_app, storefront, orderer, article1):


def test_with_multiple_items(
    party_app,
    site_app,
    storefront,
    orderer,
    article1,

M tests/integration/services/user/test_find_user.py => tests/integration/services/user/test_find_user.py +7 -7
@@ 15,7 15,7 @@ def user(make_user):
    )


def test_find_user_by_email_address_non_lowercase(party_app, user):
def test_find_user_by_email_address_non_lowercase(site_app, user):
    actual = user_service.find_user_by_email_address(
        'Carmen.Sandiego@World.example'
    )


@@ 23,23 23,23 @@ def test_find_user_by_email_address_non_lowercase(party_app, user):
    assert actual.email_address == 'carmen.sandiego@world.example'


def test_find_user_by_email_address_unknown(party_app, user):
def test_find_user_by_email_address_unknown(site_app, user):
    actual = user_service.find_user_by_email_address('no.idea@example.com')
    assert actual is None


def test_find_user_by_screen_name_case_sensitive_match(party_app, user):
def test_find_user_by_screen_name_case_sensitive_match(site_app, user):
    actual = user_service.find_user_by_screen_name('CarmenSandiego')
    assert actual is not None
    assert actual.screen_name == 'CarmenSandiego'


def test_find_user_by_screen_name_case_sensitive_miss(party_app, user):
def test_find_user_by_screen_name_case_sensitive_miss(site_app, user):
    actual = user_service.find_user_by_screen_name('cARMENsANDIEGO')
    assert actual is None


def test_find_user_by_screen_name_case_insensitive_match(party_app, user):
def test_find_user_by_screen_name_case_insensitive_match(site_app, user):
    actual = user_service.find_user_by_screen_name(
        'cARMENsANDIEGO', case_insensitive=True
    )


@@ 47,13 47,13 @@ def test_find_user_by_screen_name_case_insensitive_match(party_app, user):
    assert actual.screen_name == 'CarmenSandiego'


def test_find_user_by_screen_name_case_insensitive_miss(party_app, user):
def test_find_user_by_screen_name_case_insensitive_miss(site_app, user):
    actual = user_service.find_user_by_screen_name(
        'cARMENsANDIEGOx', case_insensitive=True
    )
    assert actual is None


def test_find_user_by_screen_name_unknown(party_app, user):
def test_find_user_by_screen_name_unknown(site_app, user):
    actual = user_service.find_user_by_screen_name('Dunno')
    assert actual is None

M tests/integration/services/user/test_update_user_details.py => tests/integration/services/user/test_update_user_details.py +3 -3
@@ 10,7 10,7 @@ from byceps.services.user import command_service as user_command_service
from byceps.services.user import event_service


def test_update_user_address(party_app, make_user_with_detail):
def test_update_user_address(site_app, make_user_with_detail):
    old_first_names = 'Rainer'
    old_last_name = 'Zufall'
    old_date_of_birth = None


@@ 91,7 91,7 @@ def test_update_user_address(party_app, make_user_with_detail):
    }


def test_update_user_real_name(party_app, make_user_with_detail):
def test_update_user_real_name(site_app, make_user_with_detail):
    old_first_names = 'Rainer'
    old_last_name = 'Zufall'



@@ 142,7 142,7 @@ def test_update_user_real_name(party_app, make_user_with_detail):
    }


def test_remove_user_dob_and_phone_number(party_app, make_user_with_detail):
def test_remove_user_dob_and_phone_number(site_app, make_user_with_detail):
    old_date_of_birth = date(1991, 9, 17)
    old_phone_number = '555-fake-anyway'


M tests/integration/services/user_badge/test_service_awarding.py => tests/integration/services/user_badge/test_service_awarding.py +6 -6
@@ 60,7 60,7 @@ def awardings_scope():


def test_award_badge_without_initiator(
    party_app, user1, badge1, awardings_scope
    site_app, user1, badge1, awardings_scope
):
    user = user1
    badge = badge1


@@ 84,7 84,7 @@ def test_award_badge_without_initiator(


def test_award_badge_with_initiator(
    party_app, user2, badge2, admin_user, awardings_scope
    site_app, user2, badge2, admin_user, awardings_scope
):
    user = user2



@@ 114,7 114,7 @@ def test_award_badge_with_initiator(


def test_count_awardings(
    party_app, user1, user2, user3, badge1, badge2, badge3, awardings_scope,
    site_app, user1, user2, user3, badge1, badge2, badge3, awardings_scope,
):
    awarding_service.award_badge_to_user(badge1.id, user1.id)
    awarding_service.award_badge_to_user(badge1.id, user1.id)


@@ 134,7 134,7 @@ def test_count_awardings(
    assert actual_relevant == {badge1.id: 4, badge2.id: 0, badge3.id: 2}


def test_get_awardings_of_unknown_badge(party_app):
def test_get_awardings_of_unknown_badge(site_app):
    unknown_badge_id = '00000000-0000-0000-0000-000000000000'

    actual = awarding_service.get_awardings_of_badge(unknown_badge_id)


@@ 142,7 142,7 @@ def test_get_awardings_of_unknown_badge(party_app):
    assert actual == set()


def test_get_awardings_of_unawarded_badge(party_app, badge3):
def test_get_awardings_of_unawarded_badge(site_app, badge3):
    badge = badge3

    actual = awarding_service.get_awardings_of_badge(badge.id)


@@ 151,7 151,7 @@ def test_get_awardings_of_unawarded_badge(party_app, badge3):


def test_get_awardings_of_badge(
    party_app, user1, user2, badge1, awardings_scope
    site_app, user1, user2, badge1, awardings_scope
):
    badge = badge1