Skip to content

Add get_order_item_by_ICC method

Administrator requested to merge feature/add-order-item-by-ICC into master

Get all order-items from a given account and retrieve the one with a given ICC. Raise OrderItemNotFoundByICC exception if we cannot find any coincidence.

>>> from pymasmovil.models.session import Session
>>> session = Session.create()
>>> from pymasmovil.models.account import Account
>>> account = Account.get(session, "0013H00000FFMvPQAX")
>>> account.get_order_item_by_ICC(session, 727272727)
<pymasmovil.models.order_item.OrderItem object at 0x7f52133b17c0>
>>> account.get_order_item_by_ISCC(session, 7276)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/www/pymasmovil/pymasmovil/models/account.py", line 110, in get_order_item_by_ICC
    raise OrderItemNotFoundByICC(ISCC, self.id)
pymasmovil.errors.exceptions.OrderItemNotFoundByICC: No order item with ICC: 7276 can be found in the account with id: 0013H00000FFMvPQAX

Merge request reports

Loading