~homeworkprod/byceps

a0ef3643030cb18f1d5a33f005b8d245acbd68d8 — Jochen Kupperschmidt 1 year, 6 months ago 62c1322
Tear down article fixtures via ID
M tests/blueprints/admin/shop/order/test_order_export.py => tests/blueprints/admin/shop/order/test_order_export.py +6 -3
@@ 60,10 60,11 @@ def article_bungalow(shop):
        Decimal('355.00'),
        Decimal('0.07'),
    )
    article_id = article.id

    yield article

    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture


@@ 75,10 76,11 @@ def article_guest_fee(shop):
        Decimal('6.00'),
        Decimal('0.19'),
    )
    article_id = article.id

    yield article

    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture


@@ 90,10 92,11 @@ def article_table(shop):
        Decimal('20.00'),
        Decimal('0.19'),
    )
    article_id = article.id

    yield article

    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture

M tests/blueprints/admin/shop/order/test_views.py => tests/blueprints/admin/shop/order/test_views.py +6 -3
@@ 72,22 72,25 @@ def admin(_admin):
@pytest.fixture
def article1(shop):
    article = create_article(shop.id, 'item-001', 8)
    article_id = article.id
    yield article
    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture
def article2(shop):
    article = create_article(shop.id, 'item-002', 8)
    article_id = article.id
    yield article
    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture
def article3(shop):
    article = create_article(shop.id, 'item-003', 8)
    article_id = article.id
    yield article
    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture(scope='module')

M tests/blueprints/site/shop/order/test_views.py => tests/blueprints/site/shop/order/test_views.py +2 -1
@@ 66,8 66,9 @@ def site(party):
@pytest.fixture
def article(party_app, shop):
    article = create_article(shop.id, quantity=5)
    article_id = article.id
    yield article
    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture

M tests/services/shop/order/actions/conftest.py => tests/services/shop/order/actions/conftest.py +2 -1
@@ 16,8 16,9 @@ from tests.services.shop.helpers import create_article
@pytest.fixture
def article(shop):
    article = create_article(shop.id, quantity=10)
    article_id = article.id
    yield article
    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture

M tests/services/shop/order/models/test_order_total_amount.py => tests/services/shop/order/models/test_order_total_amount.py +6 -3
@@ 17,22 17,25 @@ from tests.services.shop.helpers import create_article as _create_article
@pytest.fixture
def article1(shop):
    article = create_article(shop.id, 1, Decimal('49.95'))
    article_id = article.id
    yield article
    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture
def article2(shop):
    article = create_article(shop.id, 2, Decimal('6.20'))
    article_id = article.id
    yield article
    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


@pytest.fixture
def article3(shop):
    article = create_article(shop.id, 3, Decimal('12.53'))
    article_id = article.id
    yield article
    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


def test_without_any_items(party_app, shop, order_number_sequence, orderer):

M tests/services/shop/order/test_ordered_articles_service.py => tests/services/shop/order/test_ordered_articles_service.py +2 -1
@@ 20,8 20,9 @@ from tests.services.shop.helpers import create_article
@pytest.fixture
def article(shop):
    article = create_article(shop.id, quantity=100)
    article_id = article.id
    yield article
    article_service.delete_article(article.id)
    article_service.delete_article(article_id)


def test_count_ordered_articles(admin_app, shop, article, orderer):