~homeworkprod/byceps

5f0419ed0674dc22d9d514638f707a8026c2214d — Jochen Kupperschmidt a month ago b59412c
Use site ID als fallback title and server name for test sites
2 files changed, 14 insertions(+), 3 deletions(-)

M tests/conftest.py
M tests/helpers.py
M tests/conftest.py => tests/conftest.py +6 -1
@@ 174,7 174,12 @@ def email_config(make_email_config):

@pytest.fixture(scope='module')
def site(email_config, party):
    site = create_site('acmecon-2014-website', party_id=party.id)
    site = create_site(
        'acmecon-2014-website',
        title='ACMECon 2014 website',
        server_name='www.acmecon.test',
        party_id=party.id,
    )
    yield site
    site_service.delete_site(site.id)


M tests/helpers.py => tests/helpers.py +8 -2
@@ 103,8 103,8 @@ def create_party(brand_id, party_id='acmecon-2014', title='ACMECon 2014'):
def create_site(
    site_id,
    *,
    title='Website',
    server_name='www.acmecon.test',
    title=None,
    server_name=None,
    email_config_id=DEFAULT_EMAIL_CONFIG_ID,
    enabled=True,
    user_account_creation_enabled=True,


@@ 112,6 112,12 @@ def create_site(
    party_id=None,
    storefront_id=None,
):
    if title is None:
        title = site_id

    if server_name is None:
        server_name = f'{site_id}.test'

    return site_service.create_site(
        site_id,
        title,