labd / commercetools-python-sdk

Commercetools Python SDK
https://commercetools-python-sdk.readthedocs.io/en/latest/
MIT License
17 stars 16 forks source link

Requests mock querystring converts all values to a multivalve dict #12

Closed mikedebock closed 6 years ago

mikedebock commented 6 years ago

In de unit tests this doesn't work: client.product_projections.query(limit=1)

Then this error is raised: marshmallow.exceptions.ValidationError: {'limit': ['Not a valid integer.']}

That is caused by using abstract.AbstractQuerySchema().load(request.qs) which is used in "testing/product_types.py#46". That qs property on the RequestMock request object converts a querystring ?limit=1 to a multivalue dict: {'limit': [1]}, instead of a normal integer {'limit': 1}.

mvantellingen commented 6 years ago

Fixed in 68a6a79f0725ccce82c23eb4522e57092ccd275c