def test_repr_with_no_item_id(self): """ Create an order item and test it's repr with no item id """ order_item = OrderItem(product_id=1, quantity=1, price=5, status="PLACED", order_id=1) self.assertEqual(order_item.__repr__(), "<OrderItem None>")
def test_repr(self): """ Create an order item and test it's repr """ order_item = OrderItem(item_id=1, product_id=1, quantity=1, price=5, status="PLACED", order_id=1) self.assertEqual(order_item.__repr__(), "<OrderItem 1>")