Changeset - 563355485435
[Not reviewed]
0 5 0
Christopher Neugebauer - 8 years ago 2016-04-07 07:16:21
chrisjrn@gmail.com
Tests now use TestingInvoiceController
5 files changed with 27 insertions and 21 deletions:
0 comments (0 inline, 0 general)
registrasion/tests/controller_helpers.py
Show inline comments
 
from registrasion.controllers.cart import CartController
 
from registrasion.controllers.invoice import InvoiceController
 
from registrasion import models as rego
...
 
@@ -30 +31,5 @@ class TestingCartController(CartController):
 
        self.cart.save()
 

	
 

	
 
class TestingInvoiceController(InvoiceController):
 
    pass
registrasion/tests/test_discount.py
Show inline comments
...
 
@@ -6,3 +6,4 @@ from registrasion import models as rego
 
from registrasion.controllers import discount
 
from cart_controller_helper import TestingCartController
 
from controller_helpers import TestingCartController
 
from controller_helpers import TestingInvoiceController
 

	
registrasion/tests/test_invoice.py
Show inline comments
...
 
@@ -8,3 +8,3 @@ from registrasion import models as rego
 
from controller_helpers import TestingCartController
 
from registrasion.controllers.invoice import InvoiceController
 
from controller_helpers import TestingInvoiceController
 

	
...
 
@@ -22,3 +22,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_1, 1)
 
        invoice_1 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_1 = TestingInvoiceController.for_cart(current_cart.cart)
 
        # That invoice should have a single line item
...
 
@@ -31,3 +31,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_2, 1)
 
        invoice_2 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_2 = TestingInvoiceController.for_cart(current_cart.cart)
 
        self.assertNotEqual(invoice_1.invoice, invoice_2.invoice)
...
 
@@ -60,3 +60,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        with self.assertRaises(ValidationError):
 
            InvoiceController.for_cart(current_cart.cart)
 
            TestingInvoiceController.for_cart(current_cart.cart)
 

	
...
 
@@ -66,3 +66,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 

	
 
        invoice = InvoiceController.for_cart(current_cart.cart)
 
        invoice = TestingInvoiceController.for_cart(current_cart.cart)
 
        invoice.pay("A payment!", invoice.invoice.value)
...
 
@@ -101,3 +101,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_1, 1)
 
        invoice_1 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_1 = TestingInvoiceController.for_cart(current_cart.cart)
 

	
...
 
@@ -133,3 +133,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_1, 1)
 
        invoice_1 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_1 = TestingInvoiceController.for_cart(current_cart.cart)
 

	
...
 
@@ -142,3 +142,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_1, 1)
 
        invoice_1 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_1 = TestingInvoiceController.for_cart(current_cart.cart)
 

	
...
 
@@ -148,3 +148,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_2, 1)
 
        invoice_2 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_2 = TestingInvoiceController.for_cart(current_cart.cart)
 
        self.assertNotEqual(invoice_1.invoice, invoice_2.invoice)
...
 
@@ -152,3 +152,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        # Viewing invoice_1's invoice should show it as void
 
        invoice_1_new = InvoiceController(invoice_1.invoice)
 
        invoice_1_new = TestingInvoiceController(invoice_1.invoice)
 
        self.assertTrue(invoice_1_new.invoice.void)
...
 
@@ -156,3 +156,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        # Viewing invoice_2's invoice should *not* show it as void
 
        invoice_2_new = InvoiceController(invoice_2.invoice)
 
        invoice_2_new = TestingInvoiceController(invoice_2.invoice)
 
        self.assertFalse(invoice_2_new.invoice.void)
...
 
@@ -164,3 +164,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_1, 1)
 
        invoice_1 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_1 = TestingInvoiceController.for_cart(current_cart.cart)
 

	
...
 
@@ -169,3 +169,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 

	
 
        invoice_2 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_2 = TestingInvoiceController.for_cart(current_cart.cart)
 
        self.assertNotEqual(invoice_1.invoice, invoice_2.invoice)
...
 
@@ -177,3 +177,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_1, 1)
 
        invoice_1 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_1 = TestingInvoiceController.for_cart(current_cart.cart)
 

	
...
 
@@ -189,3 +189,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_1, 1)
 
        invoice_1 = InvoiceController.for_cart(current_cart.cart)
 
        invoice_1 = TestingInvoiceController.for_cart(current_cart.cart)
 

	
...
 
@@ -199,3 +199,3 @@ class InvoiceTestCase(RegistrationCartTestCase):
 
        with self.assertRaises(ValidationError):
 
            invoice_1 = InvoiceController.for_cart(current_cart.cart)
 
            invoice_1 = TestingInvoiceController.for_cart(current_cart.cart)
 

	
registrasion/tests/test_refund.py
Show inline comments
...
 
@@ -3,3 +3,3 @@ import pytz
 
from controller_helpers import TestingCartController
 
from registrasion.controllers.invoice import InvoiceController
 
from controller_helpers import TestingInvoiceController
 

	
...
 
@@ -17,3 +17,3 @@ class RefundTestCase(RegistrationCartTestCase):
 
        current_cart.add_to_cart(self.PROD_1, 1)
 
        invoice = InvoiceController.for_cart(current_cart.cart)
 
        invoice = TestingInvoiceController.for_cart(current_cart.cart)
 

	
registrasion/tests/test_voucher.py
Show inline comments
...
 
@@ -9,3 +9,3 @@ from registrasion import models as rego
 
from controller_helpers import TestingCartController
 
from registrasion.controllers.invoice import InvoiceController
 
from controller_helpers import TestingInvoiceController
 

	
...
 
@@ -142,3 +142,3 @@ class VoucherTestCases(RegistrationCartTestCase):
 

	
 
        inv = InvoiceController.for_cart(current_cart.cart)
 
        inv = TestingInvoiceController.for_cart(current_cart.cart)
 
        if not inv.invoice.paid:
0 comments (0 inline, 0 general)