def test_should_not_invoice_before_start(self): invoice_start = datetime.date(2018, 6, 1) invoice_end = datetime.date(2018, 6, 30) self.assertFalse( should_create_invoice(subscription=self.subscription, domain=self.subscription.subscriber.domain, invoice_start=invoice_start, invoice_end=invoice_end))
def test_should_not_invoice_before_start(self): invoice_start = datetime.date(2018, 6, 1) invoice_end = datetime.date(2018, 6, 30) self.assertFalse(should_create_invoice( subscription=self.subscription, domain=self.subscription.subscriber.domain, invoice_start=invoice_start, invoice_end=invoice_end ))
def test_should_not_invoice_without_subscription_charges(self): feature_charge_domain = generator.arbitrary_domain() subscription = Subscription.new_domain_subscription( self.account, feature_charge_domain.name, self.advanced_plan, date_start=self.invoice_start ) subscription.skip_invoicing_if_no_feature_charges = True self.assertFalse(should_create_invoice( subscription=subscription, domain=subscription.subscriber.domain, invoice_start=self.invoice_start, invoice_end=self.invoice_end )) feature_charge_domain.delete()
def test_should_not_invoice_trial(self): trial_domain = generator.arbitrary_domain() subscription = Subscription.new_domain_subscription( self.account, trial_domain.name, self.advanced_plan, date_start=self.invoice_start ) subscription.is_trial = True self.assertFalse(should_create_invoice( subscription=subscription, domain=subscription.subscriber.domain, invoice_start=self.invoice_start, invoice_end=self.invoice_end )) trial_domain.delete()
def test_should_not_invoice_paused_plan(self): """ Ensure that paused plans do not generate a CustomerInvoice """ paused_domain = generator.arbitrary_domain() self.addCleanup(paused_domain.delete) paused_plan = generator.subscribable_plan_version( edition=SoftwarePlanEdition.PAUSED) paused_plan.plan.is_customer_software_plan = True subscription = Subscription.new_domain_subscription( self.account, paused_domain.name, paused_plan, date_start=self.invoice_start, ) self.assertFalse( should_create_invoice(subscription=subscription, domain=subscription.subscriber.domain, invoice_start=self.invoice_start, invoice_end=self.invoice_end))