diff --git a/registrasion/controllers/invoice.py b/registrasion/controllers/invoice.py index de401d31a11a539873c4ee99f0befe192eef3a99..fce09f8faca9f5370b0484ae73e0775e9de88d21 100644 --- a/registrasion/controllers/invoice.py +++ b/registrasion/controllers/invoice.py @@ -142,7 +142,6 @@ class InvoiceController(object): return False - def _refresh(self): ''' Refreshes the underlying invoice and cart objects. ''' self.invoice.refresh_from_db() diff --git a/registrasion/tests/controller_helpers.py b/registrasion/tests/controller_helpers.py index 476351ddfea5cc59e30d2c29823c3f4ef8b94c4f..ad8661b6d1627229a13ba75bce24dfce4e3a6c8c 100644 --- a/registrasion/tests/controller_helpers.py +++ b/registrasion/tests/controller_helpers.py @@ -3,7 +3,6 @@ from registrasion.controllers.invoice import InvoiceController from registrasion import models as rego from django.core.exceptions import ObjectDoesNotExist -from django.core.exceptions import ValidationError class TestingCartController(CartController): @@ -41,7 +40,7 @@ class TestingInvoiceController(InvoiceController): self.validate_allowed_to_pay() ''' Adds a payment ''' - payment = rego.ManualPayment.objects.create( + rego.ManualPayment.objects.create( invoice=self.invoice, reference=reference, amount=amount, diff --git a/registrasion/tests/test_discount.py b/registrasion/tests/test_discount.py index e91053789fccf8e20b5a493e3a8f965a65a34307..e84ca283b238be41c3a2f0cc073ce94cd2b6d792 100644 --- a/registrasion/tests/test_discount.py +++ b/registrasion/tests/test_discount.py @@ -5,7 +5,6 @@ from decimal import Decimal from registrasion import models as rego from registrasion.controllers import discount from controller_helpers import TestingCartController -from controller_helpers import TestingInvoiceController from test_cart import RegistrationCartTestCase diff --git a/registrasion/tests/test_invoice.py b/registrasion/tests/test_invoice.py index b121bfa1d034707a82156e6158203909b1665a91..7854680dc4c4b6455c38e29b4b050f4c9e919bb4 100644 --- a/registrasion/tests/test_invoice.py +++ b/registrasion/tests/test_invoice.py @@ -197,7 +197,7 @@ class InvoiceTestCase(RegistrationCartTestCase): def test_cannot_generate_blank_invoice(self): current_cart = TestingCartController.for_user(self.USER_1) with self.assertRaises(ValidationError): - invoice_1 = TestingInvoiceController.for_cart(current_cart.cart) + TestingInvoiceController.for_cart(current_cart.cart) def test_cannot_pay_implicitly_void_invoice(self): cart = TestingCartController.for_user(self.USER_1) @@ -210,8 +210,6 @@ class InvoiceTestCase(RegistrationCartTestCase): with self.assertRaises(ValidationError): invoice.validate_allowed_to_pay() - - # TODO: test partially paid invoice cannot be void until payments # are refunded diff --git a/registrasion/util.py b/registrasion/util.py index fb97d1d5cba90778e8bfec02d77a3dd2c5eb92ac..3df548004868728690cb5459ec68bd0a9ca3de16 100644 --- a/registrasion/util.py +++ b/registrasion/util.py @@ -2,6 +2,7 @@ import string from django.utils.crypto import get_random_string + def generate_access_code(): ''' Generates an access code for users' payments as well as their fulfilment code for check-in. diff --git a/registrasion/views.py b/registrasion/views.py index 1b0fe64655b38b3c65ef8eaecfa5e0215af34d54..f07956476b0ee14b50e96851da35fa870c28ba87 100644 --- a/registrasion/views.py +++ b/registrasion/views.py @@ -484,7 +484,7 @@ def invoice(request, invoice_id, access_code=None): if not current_invoice.can_view( user=request.user, access_code=access_code, - ): + ): raise Http404() data = {