Test fixes

There are a number of attempts to use Deci in ints, which won't work in
2.7 or 3.x, we fix that.

Description doesn't exist in symposion.  So that fails our tests pretty
hard.  Switch that to Private Abstract.  It's clear these tests have not
been run in a very long time.  So both failures and especially passes
need to be taken with salt.
This commit is contained in:
Sachi King 2017-04-22 18:43:50 +10:00
parent b156be1e7e
commit 03c7633169
3 changed files with 8 additions and 4 deletions

View file

@ -85,7 +85,7 @@ class RegistrationCartTestCase(MixInPatches, TestCase):
prod = inventory.Product.objects.create(
name="Product " + str(i + 1),
description="This is a test product.",
category=cls.categories[i / 2], # 2 products per category
category=cls.categories[int(i / 2)], # 2 products per category
price=Decimal("10.00"),
reservation_duration=cls.RESERVATION,
limit_per_user=10,

View file

@ -98,7 +98,11 @@ class InvoiceTestCase(TestHelperMixin, RegistrationCartTestCase):
def test_total_payments_balance_due(self):
invoice = self._invoice_containing_prod_1(2)
for i in xrange(0, invoice.invoice.value):
# range only takes int, and the following logic fails if not a round
# number. So fail if we are not a round number so developer may fix
# this test or the product.
self.assertTrue((invoice.invoice.value % 1).is_zero())
for i in range(0, int(invoice.invoice.value)):
self.assertTrue(
i + 1, invoice.invoice.total_payments()
)

View file

@ -67,7 +67,7 @@ class SpeakerTestCase(RegistrationCartTestCase):
kind=kind_1,
title="Proposal 1",
abstract="Abstract",
description="Description",
private_abstract="Private Abstract",
speaker=speaker_1,
)
proposal_models.AdditionalSpeaker.objects.create(
@ -80,7 +80,7 @@ class SpeakerTestCase(RegistrationCartTestCase):
kind=kind_2,
title="Proposal 2",
abstract="Abstract",
description="Description",
private_abstract="Private Abstract",
speaker=speaker_1,
)
proposal_models.AdditionalSpeaker.objects.create(