def test_update_order_line_does_not_exist(superuser_api_client):
    variables = {
        "id": to_global_id(OrderLineNode, uuid.uuid4()),
    }
    executed = superuser_api_client.execute(UPDATE_ORDER_LINE_MUTATION, input=variables)

    assert_doesnt_exist("OrderLine", executed)
def test_delete_additional_product_does_not_exist(superuser_api_client):
    variables = {"id": to_global_id(AdditionalProductNode, uuid.uuid4())}

    executed = superuser_api_client.execute(
        DELETE_ADDITIONAL_PRODUCT_MUTATION, input=variables
    )

    assert_doesnt_exist("AdditionalProduct", executed)
def test_delete_winter_storage_product_does_not_exist(superuser_api_client):
    variables = {"id": to_global_id(WinterStorageProductNode, uuid.uuid4())}

    executed = superuser_api_client.execute(
        DELETE_WINTER_STORAGE_PRODUCT_MUTATION, input=variables
    )

    assert_doesnt_exist("WinterStorageProduct", executed)
def test_delete_berth_product_does_not_exist(superuser_api_client):
    variables = {"id": to_global_id(BerthProductNode, uuid.uuid4())}

    executed = superuser_api_client.execute(
        DELETE_BERTH_PRODUCT_MUTATION, input=variables
    )

    assert_doesnt_exist("BerthProduct", executed)
Пример #5
0
def test_update_offer_does_not_exist(superuser_api_client):
    variables = {
        "id": to_global_id(BerthSwitchOfferNode, uuid.uuid4()),
    }
    executed = superuser_api_client.execute(UPDATE_OFFER_MUTATION,
                                            input=variables)

    assert_doesnt_exist("BerthSwitchOffer", executed)
def test_delete_boat_does_not_exist(superuser_api_client):
    variables = {
        "id": to_global_id(BoatNode, uuid.uuid4()),
    }

    executed = superuser_api_client.execute(DELETE_BOAT_MUTATION, input=variables)

    assert_doesnt_exist("Boat", executed)
def test_accept_berth_switch_offer_does_not_exist(user_api_client):
    variables = {
        "offerNumber": "test",
        "isAccepted": True,
    }
    executed = user_api_client.execute(ACCEPT_BERTH_SWITCH_OFFER_MUTATION,
                                       input=variables)

    assert_doesnt_exist("BerthSwitchOffer", executed)
def test_delete_berth_application_inexistent_application(superuser_api_client):
    variables = {
        "id": to_global_id(BerthApplicationNode, random.randint(0, 100)),
    }

    executed = superuser_api_client.execute(DELETE_BERTH_APPLICATION_MUTATION,
                                            input=variables)

    assert_doesnt_exist("BerthApplication", executed)
def test_delete_berth_service_profile_does_not_exist(superuser_api_client):
    variables = {
        "id": to_global_id(ProfileNode, uuid.uuid4()),
    }

    executed = superuser_api_client.execute(
        DELETE_BERTH_SERVICE_PROFILE_MUTATION, input=variables
    )

    assert_doesnt_exist("CustomerProfile", executed)
def test_cancel_order_does_not_exist(superuser_api_client):
    variables = {"orderNumber": generate_order_number()}

    with mock.patch(
        "payments.providers.bambora_payform.requests.post",
        side_effect=mocked_response_create,
    ):
        executed = superuser_api_client.execute(CANCEL_ORDER_MUTATION, input=variables)

    assert_doesnt_exist("Order", executed)
Пример #11
0
def test_create_berth_switch_offer_application_does_not_exist(
        superuser_api_client, berth):
    variables = {
        "applicationId": to_global_id(BerthApplicationNode, randint(0, 100)),
        "newBerthId": to_global_id(BerthNode, berth.id),
    }

    executed = superuser_api_client.execute(CREATE_BERTH_SWITCH_OFFER_MUTATION,
                                            input=variables)

    assert_doesnt_exist("BerthApplication", executed)
def test_delete_winter_storage_application_inexistent_application(
    superuser_api_client, ):
    variables = {
        "id": to_global_id(WinterStorageApplicationNode,
                           random.randint(0, 100)),
    }

    executed = superuser_api_client.execute(
        DELETE_WINTER_STORAGE_APPLICATION_MUTATION, input=variables)

    assert_doesnt_exist("WinterStorageApplication", executed)
def test_create_order_line_product_does_not_exist(superuser_api_client, order):
    variables = {
        "orderId": to_global_id(OrderNode, order.id),
        "productId": to_global_id(AdditionalProductNode, uuid.uuid4()),
    }

    assert OrderLine.objects.count() == 0

    executed = superuser_api_client.execute(CREATE_ORDER_LINE_MUTATION, input=variables)

    assert OrderLine.objects.count() == 0
    assert_doesnt_exist("AdditionalProduct", executed)
Пример #14
0
def test_create_berth_switch_offer_berth_does_not_exist(
        superuser_api_client, berth_application, customer_profile):
    berth_application.berth_switch = BerthSwitchFactory()
    berth_application.customer = customer_profile
    berth_application.save()

    variables = {
        "applicationId": to_global_id(BerthApplicationNode,
                                      berth_application.id),
        "newBerthId": to_global_id(BerthNode, uuid4()),
    }

    executed = superuser_api_client.execute(CREATE_BERTH_SWITCH_OFFER_MUTATION,
                                            input=variables)

    assert_doesnt_exist("Berth", executed)
Пример #15
0
def test_refund_order_does_not_exist(
    superuser_api_client, payment_provider, notification_template_orders_approved,
):
    order_id = to_global_id(OrderNode, uuid.uuid4())

    variables = {"orderId": order_id}

    with mock.patch(
        "payments.providers.bambora_payform.requests.post",
        side_effect=mocked_refund_response_create,
    ), mock.patch(
        "payments.providers.bambora_payform.BamboraPayformProvider.get_payment_details",
        side_effect=mocked_refund_payment_details(products=[]),
    ):
        executed = superuser_api_client.execute(REFUND_ORDER_MUTATION, input=variables)

    assert_doesnt_exist("Order", executed)
def test_delete_order_does_not_exist(superuser_api_client):
    variables = {"id": to_global_id(OrderNode, uuid.uuid4())}

    executed = superuser_api_client.execute(DELETE_ORDER_MUTATION, input=variables)

    assert_doesnt_exist("Order", executed)
def test_get_order_status_order_does_not_exist(superuser_api_client):
    executed = superuser_api_client.execute(ORDER_DETAILS_QUERY %
                                            generate_order_number())

    assert_doesnt_exist("Order", executed)