'This tests the generate_receipt_instructions call chain (ie calling the function on the
cart also calls it on items in the cart'

def test_generate_receipt_instructions_callchain(self):

    mock_gen_inst = MagicMock(return_value=(OrderItemSubclassPK(OrderItem, 1), set([])))
    cart = Order.get_cart_for_user(self.user)
    item = OrderItem(user=self.user, order=cart)
    item.save()
    self.assertTrue(cart.has_items())
    with patch.object(OrderItem, 'generate_receipt_instructions', mock_gen_inst):
        cart.generate_receipt_instructions()
        mock_gen_inst.assert_called_with()
