Ejemplo n.º 1
0
def test_get_order_by_order_id():
    order = Order()
    order_info = order.get_order_by_order_id(1)
    assert 'order_id' in order_info and 'customer_id' in order_info and 'store_id' in order_info and \
           'order_date' in order_info and 'customer_name' in order_info and 'customer_phone_number' in order_info and \
           'customer_mail' in order_info and 'customer_street' in order_info and 'customer_city' in order_info and \
           'customer_state' in order_info and 'customer_zip_code' in order_info and 'products' in order_info
Ejemplo n.º 2
0
    def get(self):
        try:
            order = Order()
            json = request.json

            ans = []
            if json is not None and 'order_id' in json:
                ans = order.get_order_by_order_id(json['order_id'])
                # inventory.modify_stock()
            return {'success': True, 'products': ans}
        except Exception as e:
            return {'success': False, 'Error': str(e)}