Files
@ 565a90f61829
Branch filter:
Location: symposion_app/vendor/registrasion/tests/test_refund.py - annotation
565a90f61829
1.3 KiB
text/x-python
Add a note to get the permission required for papers review
So not obvious...
So not obvious...
cf85af771983 cf85af771983 17693754de69 17693754de69 cf85af771983 17693754de69 cf85af771983 63dfd353c16e 63dfd353c16e cf85af771983 cf85af771983 cf85af771983 cf85af771983 cf85af771983 cf85af771983 eab1deff7776 cf85af771983 cf85af771983 cf85af771983 563355485435 cf85af771983 cf85af771983 38cdb8aa6330 38cdb8aa6330 38cdb8aa6330 63dfd353c16e 63dfd353c16e 63dfd353c16e 63dfd353c16e cf85af771983 6b10a0a7e427 38cdb8aa6330 38cdb8aa6330 38cdb8aa6330 63dfd353c16e 63dfd353c16e 63dfd353c16e 63dfd353c16e | import pytz
from registrasion.tests.controller_helpers import TestingCartController
from registrasion.tests.controller_helpers import TestingInvoiceController
from registrasion.tests.test_cart import RegistrationCartTestCase
from registrasion.models import commerce
UTC = pytz.timezone('UTC')
class RefundTestCase(RegistrationCartTestCase):
def test_refund_marks_void_and_unpaid_and_cart_released(self):
current_cart = TestingCartController.for_user(self.USER_1)
# Should be able to create an invoice after the product is added
current_cart.add_to_cart(self.PROD_1, 1)
invoice = TestingInvoiceController.for_cart(current_cart.cart)
invoice.pay("A Payment!", invoice.invoice.value)
self.assertFalse(invoice.invoice.is_void)
self.assertTrue(invoice.invoice.is_paid)
self.assertFalse(invoice.invoice.is_refunded)
self.assertNotEqual(
commerce.Cart.STATUS_RELEASED,
invoice.invoice.cart.status,
)
invoice.refund()
self.assertFalse(invoice.invoice.is_void)
self.assertFalse(invoice.invoice.is_paid)
self.assertTrue(invoice.invoice.is_refunded)
self.assertEqual(
commerce.Cart.STATUS_RELEASED,
invoice.invoice.cart.status,
)
|