Flake8 fixes

This commit is contained in:
Christopher Neugebauer 2016-04-08 19:49:18 +10:00
parent b320b227aa
commit ae8f39381f
6 changed files with 4 additions and 8 deletions

View file

@ -142,7 +142,6 @@ class InvoiceController(object):
return False return False
def _refresh(self): def _refresh(self):
''' Refreshes the underlying invoice and cart objects. ''' ''' Refreshes the underlying invoice and cart objects. '''
self.invoice.refresh_from_db() self.invoice.refresh_from_db()

View file

@ -3,7 +3,6 @@ from registrasion.controllers.invoice import InvoiceController
from registrasion import models as rego from registrasion import models as rego
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import ValidationError
class TestingCartController(CartController): class TestingCartController(CartController):
@ -41,7 +40,7 @@ class TestingInvoiceController(InvoiceController):
self.validate_allowed_to_pay() self.validate_allowed_to_pay()
''' Adds a payment ''' ''' Adds a payment '''
payment = rego.ManualPayment.objects.create( rego.ManualPayment.objects.create(
invoice=self.invoice, invoice=self.invoice,
reference=reference, reference=reference,
amount=amount, amount=amount,

View file

@ -5,7 +5,6 @@ from decimal import Decimal
from registrasion import models as rego from registrasion import models as rego
from registrasion.controllers import discount from registrasion.controllers import discount
from controller_helpers import TestingCartController from controller_helpers import TestingCartController
from controller_helpers import TestingInvoiceController
from test_cart import RegistrationCartTestCase from test_cart import RegistrationCartTestCase

View file

@ -197,7 +197,7 @@ class InvoiceTestCase(RegistrationCartTestCase):
def test_cannot_generate_blank_invoice(self): def test_cannot_generate_blank_invoice(self):
current_cart = TestingCartController.for_user(self.USER_1) current_cart = TestingCartController.for_user(self.USER_1)
with self.assertRaises(ValidationError): 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): def test_cannot_pay_implicitly_void_invoice(self):
cart = TestingCartController.for_user(self.USER_1) cart = TestingCartController.for_user(self.USER_1)
@ -210,8 +210,6 @@ class InvoiceTestCase(RegistrationCartTestCase):
with self.assertRaises(ValidationError): with self.assertRaises(ValidationError):
invoice.validate_allowed_to_pay() invoice.validate_allowed_to_pay()
# TODO: test partially paid invoice cannot be void until payments # TODO: test partially paid invoice cannot be void until payments
# are refunded # are refunded

View file

@ -2,6 +2,7 @@ import string
from django.utils.crypto import get_random_string from django.utils.crypto import get_random_string
def generate_access_code(): def generate_access_code():
''' Generates an access code for users' payments as well as their ''' Generates an access code for users' payments as well as their
fulfilment code for check-in. fulfilment code for check-in.

View file

@ -484,7 +484,7 @@ def invoice(request, invoice_id, access_code=None):
if not current_invoice.can_view( if not current_invoice.can_view(
user=request.user, user=request.user,
access_code=access_code, access_code=access_code,
): ):
raise Http404() raise Http404()
data = { data = {