How to use the testfixtures.shop_order.create_orderer function in testfixtures

To help you get started, we’ve selected a few testfixtures examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github byceps / byceps / tests / integration / services / shop / order / actions / test_create_ticket_bundles.py View on Github external
def test_create_ticket_bundles(
    admin_app,
    party,
    storefront,
    article,
    ticket_category,
    admin_user,
    make_user_with_detail,
):
    ticket_quantity = 5
    bundle_quantity = 2
    orderer = create_orderer(make_user_with_detail('TicketBundleOrderer'))

    action_registry_service.register_ticket_bundles_creation(
        article.item_number, ticket_category.id, ticket_quantity
    )

    articles_with_quantity = [(article, bundle_quantity)]
    order = place_order(storefront.id, orderer, articles_with_quantity)

    tickets_before_paid = get_tickets_for_order(order)
    assert len(tickets_before_paid) == 0

    mark_order_as_paid(order.id, admin_user.id)

    tickets_after_paid = get_tickets_for_order(order)
    assert len(tickets_after_paid) == 10
github byceps / byceps / tests / integration / services / shop / order / models / test_order_total_amount.py View on Github external
def orderer(make_user_with_detail):
    return create_orderer(make_user_with_detail('TotalAmountOrderer'))
github byceps / byceps / tests / integration / services / shop / order / test_service_orders_placed_by_user.py View on Github external
def orderer1(make_user_with_detail):
    user = make_user_with_detail('Orderer1')
    return create_orderer(user)
github byceps / byceps / tests / integration / blueprints / site / shop / orders / test_views.py View on Github external
def order(storefront1, user1):
    orderer = create_orderer(user1)
    cart = Cart()

    order, _ = order_service.place_order(storefront1.id, orderer, cart)

    yield order

    order_service.delete_order(order.id)
github byceps / byceps / tests / integration / services / shop / order / test_service_mark_order_as_paid.py View on Github external
def orderer(make_user_with_detail):
    return create_orderer(make_user_with_detail('PayingOrderer'))
github byceps / byceps / tests / integration / services / shop / order / test_ordered_articles_service.py View on Github external
def orderer(make_user_with_detail):
    return create_orderer(make_user_with_detail('ArticlesForStatsOrderer'))
github byceps / byceps / tests / integration / services / shop / order / test_service_orders_placed_by_user.py View on Github external
def orderer2(make_user_with_detail):
    user = make_user_with_detail('Orderer2')
    return create_orderer(user)
github byceps / byceps / tests / integration / services / shop / order / email / base.py View on Github external
def place_order_with_items(
    storefront_id, user, created_at=None, items_with_quantity=None
):
    orderer = create_orderer(user)

    cart = Cart()

    if items_with_quantity is not None:
        for article, quantity in items_with_quantity:
            cart.add_item(article, quantity)

    order, _ = order_service.place_order(
        storefront_id, orderer, cart, created_at=created_at
    )

    return order
github byceps / byceps / tests / integration / announce / irc / test_shop_order.py View on Github external
def orderer(make_user_with_detail):
    user = make_user_with_detail('Ken_von_Kaufkraft')
    user_id = user.id
    yield create_orderer(user)
    user_command_service.delete_account(user_id, user_id, 'clean up')
github byceps / byceps / tests / integration / services / shop / order / actions / test_create_tickets.py View on Github external
def test_create_tickets(
    admin_app,
    party,
    storefront,
    article,
    ticket_category,
    admin_user,
    make_user_with_detail,
):
    ticket_quantity = 4
    orderer = create_orderer(make_user_with_detail('TicketsOrderer'))

    action_registry_service.register_tickets_creation(
        article.item_number, ticket_category.id
    )

    articles_with_quantity = [(article, ticket_quantity)]
    order = place_order(storefront.id, orderer, articles_with_quantity)

    tickets_before_paid = get_tickets_for_order(order)
    assert len(tickets_before_paid) == 0

    mark_order_as_paid(order.id, admin_user.id)

    tickets_after_paid = get_tickets_for_order(order)
    assert len(tickets_after_paid) == ticket_quantity