commercetools-python-sdk icon indicating copy to clipboard operation
commercetools-python-sdk copied to clipboard

predicate with date not allowed

Open davidweterings opened this issue 4 years ago • 0 comments

Commercetools allows predicates like lastModifiedAt > "2021-05-01" but it gives a marshmallow validation error.

def test_orders_query_filter_single_date(commercetools_api, old_client):
    order = get_test_order()
    commercetools_api.orders.add_existing(order)
    where = [
        'createdAt >= "2019-10-15"',
    ]

    results = old_client.orders.query(where=where)
    assert results.total == 1

Probably have to handle/detect in testing/predicates.py 503 if it's a datetime and convert to a valid datetime

davidweterings avatar May 04 '21 13:05 davidweterings