~homeworkprod/byceps

b1b869e450b942d28e15ccc001b0cff4b2a2f0b9 — Jochen Kupperschmidt 1 year, 5 months ago d303e94
Use `make_user`
M tests/blueprints/admin/newsletter/test_views.py => tests/blueprints/admin/newsletter/test_views.py +7 -2
@@ 91,8 91,13 @@ def test_export_subscriber_email_addresses(newsletter_list, subscribers, client)


@pytest.fixture(scope='module')
def newsletter_admin():
    admin = create_user('NewsletterAdmin')
def _newsletter_admin(make_user):
    yield from make_user('NewsletterAdmin')


@pytest.fixture(scope='module')
def newsletter_admin(_newsletter_admin):
    admin = _newsletter_admin

    permission_ids = {'admin.access', 'newsletter.export_subscribers'}
    role_id = 'newsletter_admin'

M tests/blueprints/admin/shop/order/test_order_export.py => tests/blueprints/admin/shop/order/test_order_export.py +16 -5
@@ 20,7 20,6 @@ from byceps.services.shop.sequence import service as sequence_service
from tests.helpers import (
    create_permissions,
    create_role_with_permissions_assigned,
    create_user,
    http_client,
    login_user,
)


@@ 28,8 27,13 @@ from tests.services.shop.helpers import create_article as _create_article


@pytest.fixture(scope='module')
def admin_user(admin_app_with_db):
    admin = create_user('ShopOrderAdmin')
def _admin_user(make_user):
    yield from make_user('ShopOrderAdmin')


@pytest.fixture(scope='module')
def admin_user(_admin_user):
    admin = _admin_user

    permission_ids = {'admin.access', 'shop_order.view'}
    role_id = 'order_admin'


@@ 104,8 108,15 @@ def cart(article_bungalow, article_guest_fee, article_table):


@pytest.fixture
def orderer():
    user = create_user('Besteller', email_address='h-w.mustermann@example.com')
def _orderer(make_user):
    yield from make_user(
        'Besteller', email_address='h-w.mustermann@example.com'
    )


@pytest.fixture
def orderer(_orderer):
    user = _orderer

    return Orderer(
        user.id,

M tests/blueprints/admin/shop/order/test_views.py => tests/blueprints/admin/shop/order/test_views.py +7 -3
@@ 25,7 25,6 @@ from testfixtures.shop_order import create_orderer
from tests.helpers import (
    create_permissions,
    create_role_with_permissions_assigned,
    create_user,
    create_user_with_detail,
    http_client,
    login_user,


@@ 41,8 40,13 @@ def order_number_sequence(shop) -> None:


@pytest.fixture(scope='module')
def admin():
    admin = create_user('ShopOrderAdmin')
def _admin(make_user):
    yield from make_user('ShopOrderAdmin')


@pytest.fixture(scope='module')
def admin(_admin):
    admin = _admin

    permission_ids = {
        'admin.access',

M tests/services/ticketing/conftest.py => tests/services/ticketing/conftest.py +8 -10
@@ 7,8 7,6 @@ import pytest

from byceps.services.ticketing import category_service

from tests.helpers import create_user


@pytest.fixture(scope='module')
def category(party):


@@ 25,20 23,20 @@ def another_category(party):


@pytest.fixture(scope='module')
def ticketing_admin(admin_app_with_db):
    return create_user('TicketingAdmin')
def ticketing_admin(make_user):
    yield from make_user('TicketingAdmin')


@pytest.fixture(scope='module')
def ticket_manager(admin_app_with_db):
    return create_user('TicketManager')
def ticket_manager(make_user):
    yield from make_user('TicketManager')


@pytest.fixture(scope='module')
def ticket_owner(admin_app_with_db):
    return create_user('TicketOwner')
def ticket_owner(make_user):
    yield from make_user('TicketOwner')


@pytest.fixture(scope='module')
def ticket_user(admin_app_with_db):
    return create_user('TicketUser')
def ticket_user(make_user):
    yield from make_user('TicketUser')

M tests/services/user/test_find_user.py => tests/services/user/test_find_user.py +2 -4
@@ 7,12 7,10 @@ import pytest

from byceps.services.user import service as user_service

from tests.helpers import create_user


@pytest.fixture(scope='module')
def user():
    return create_user(
def user(make_user):
    yield from make_user(
        'CarmenSandiego', email_address='carmen.sandiego@world.example'
    )


M tests/services/user_badge/test_service_awarding.py => tests/services/user_badge/test_service_awarding.py +6 -8
@@ 16,22 16,20 @@ from byceps.services.user_badge.models.awarding import (
)
from byceps.services.user_badge.transfer.models import QuantifiedBadgeAwarding

from ...helpers import create_user


@pytest.fixture(scope='module')
def user1():
    return create_user('Stullenandi')
def user1(make_user):
    yield from make_user('Stullenandi')


@pytest.fixture(scope='module')
def user2():
    return create_user('Anica')
def user2(make_user):
    yield from make_user('Anica')


@pytest.fixture(scope='module')
def user3():
    return create_user('Slobo')
def user3(make_user):
    yield from make_user('Slobo')


@pytest.fixture(scope='module')