Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions django_ledger/tests/test_bill.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,13 @@ def test_bill_detail(self):
# amount paid is shown
self.assertContains(bill_detail_response, 'id="djl-bill-detail-amount-paid"')

# amount owed is shown
self.assertContains(bill_detail_response, 'id="djl-bill-detail-amount-owed"')

if not bill_model.accrue:
# amount prepaid is not shown
self.assertNotContains(bill_detail_response, ' id="djl-bill-detail-amount-prepaid"')
# amount unearned is not shown
self.assertNotContains(bill_detail_response, ' id="djl-bill-detail-amount-unearned"')
# amount owed is shown
self.assertContains(bill_detail_response, 'id="djl-bill-detail-amount-owed"')

else:
# amount prepaid is shown
Expand Down
12 changes: 7 additions & 5 deletions django_ledger/tests/test_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ def test_blank_data(self):
self.assertFalse(form.is_valid(), msg='Form without data is supposed to be invalid')

def test_invalid_account(self):
with self.assertRaises(ObjectDoesNotExist):
form = TransactionModelForm({
'account': 'Asset',
})
form.is_valid()
form = TransactionModelForm({
'account': 'Asset',
'tx_type': 'debit',
'amount': Decimal(randint(10000, 99999)),
'description': 'Bought Something Else ...'
})
self.assertIn('“Asset” is not a valid UUID.', form.errors.as_text())


class TransactionModelFormSetTest(DjangoLedgerBaseTest):
Expand Down