'Test error cases for retiring an order:
1) Order item has a different status than the order
2) The order\'s status isn\'t in "cart" or "paying"'

@ddt.data(('cart', 'paying', UnexpectedOrderItemStatus), ('purchased', 'purchased', InvalidStatusToRetire))
@ddt.unpack
def test_retire_order_error(self, order_status, item_status, exception):

    cart = Order.get_cart_for_user(user=self.user)
    item = CertificateItem.add_to_order(cart, self.course_key, self.cost, 'honor', currency='usd')
    cart.status = order_status
    cart.save()
    item.status = item_status
    item.save()
    with self.assertRaises(exception):
        cart.retire()
