Beispiel #1
0
def test_adding_extra_fields_to_the_delivery(rf):
    try:
        import weasyprint
    except ImportError:
        pytest.skip()

    shop = get_default_shop()
    supplier = get_default_supplier()
    product = create_product("simple-test-product", shop)
    order = create_order_with_product(product, supplier, 6, 6, shop=shop)
    shipment = order.create_shipment_of_all_products(supplier)
    request = rf.get("/")

    with override_provides("order_printouts_delivery_extra_fields", [
        "shuup_tests.order_printouts.test_printouts:PrintoutTestDeliveryExtraFields",
    ]):
        response = get_delivery_html(request, shipment.id)
        assert response.status_code == 200
        assert "123456789" in response.content.decode()
        assert "Random" in response.content.decode()
Beispiel #2
0
def test_adding_extra_fields_to_the_delivery(rf):
    try:
        import weasyprint
    except ImportError:
        pytest.skip()

    shop = get_default_shop()
    supplier = get_default_supplier()
    product = create_product("simple-test-product", shop)
    order = create_order_with_product(product, supplier, 6, 6, shop=shop)
    shipment = order.create_shipment_of_all_products(supplier)
    request = rf.get("/")

    with override_provides("order_printouts_delivery_extra_fields", [
            "shuup_tests.order_printouts.test_printouts:PrintoutTestDeliveryExtraFields",
    ]):
        response = get_delivery_html(request, shipment.id)
        assert response.status_code == 200
        assert "123456789" in response.content.decode()
        assert "Random" in response.content.decode()