Various updates
This commit is contained in:
parent
e169b8c1d1
commit
89519e48a9
5 changed files with 80 additions and 57 deletions
|
|
@ -144,6 +144,13 @@ class BillAndOrderTestCase(TestCase):
|
|||
billing_address=BillingAddress.get_address_for(self.recurring_user)
|
||||
)
|
||||
|
||||
# used for generating multiple bills
|
||||
self.bill_dates = [
|
||||
timezone.make_aware(datetime.datetime(2020,3,31)),
|
||||
timezone.make_aware(datetime.datetime(2020,4,30)),
|
||||
timezone.make_aware(datetime.datetime(2020,5,31)),
|
||||
]
|
||||
|
||||
|
||||
def test_bill_one_time_one_bill_record(self):
|
||||
"""
|
||||
|
|
@ -173,6 +180,21 @@ class BillAndOrderTestCase(TestCase):
|
|||
self.assertEqual(self.recurring_order.billrecord_set.count(), 1)
|
||||
self.assertEqual(bill.billrecord_set.count(), 1)
|
||||
|
||||
|
||||
def test_new_bill_after_closing(self):
|
||||
"""
|
||||
After closing a bill and the user has a recurring product,
|
||||
the next bill run should create e new bill
|
||||
"""
|
||||
|
||||
for ending_date in self.bill_dates:
|
||||
Bill.create_next_bill_for_user(self.recurring_user, ending_date)
|
||||
|
||||
bills_count = Bill.objects.filter(owner=self.recurring_user).count()
|
||||
|
||||
self.assertEqual(len(self.bill_dates), bill_count)
|
||||
|
||||
|
||||
# class NotABillingTC(TestCase):
|
||||
# #class BillingTestCase(TestCase):
|
||||
# def setUp(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue