Skip to content

Commit 61671dc

Browse files
committed
Add unittest for predicate field in query methods
1 parent 176cac7 commit 61671dc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_service_products.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import uuid
22

33
import pytest
4+
import requests_mock
45
from requests.exceptions import HTTPError
56

67
from commercetools import types
@@ -271,3 +272,14 @@ def test_product_update_add_price_current(client):
271272

272273
assert product.master_data.staged is None
273274
assert len(product.master_data.current.master_variant.prices) == 1
275+
276+
277+
def test_predicate_var(client):
278+
with requests_mock.Mocker(real_http=True, case_sensitive=True) as m:
279+
280+
result = client.products.query(
281+
where="masterData(staged(masterVariant(prices(country='NL'))))",
282+
predicate_var={"foo": "bar"},
283+
)
284+
285+
assert "var.foo" in m.request_history[0].qs

0 commit comments

Comments
 (0)