Пример #1
0
 def test_new_subscription_without_end_date_is_included(self):
     new_subscription = Subscription.new_domain_subscription(
         account=self.customer_account,
         domain=self.domain.name,
         plan_version=self.customer_plan_version,
         date_start=date(2019, 5, 31),
     )
     line_item_factory = LineItemFactory(new_subscription, None,
                                         self.mock_customer_invoice)
     self.assertEqual(line_item_factory.subscribed_domains,
                      [self.domain.name])
Пример #2
0
 def test_future_subscription_is_excluded(self):
     future_subscription = Subscription.new_domain_subscription(
         account=self.customer_account,
         domain=self.domain.name,
         plan_version=self.customer_plan_version,
         date_start=date(2019, 6, 1),
         date_end=date(2019, 7, 1),
     )
     line_item_factory = LineItemFactory(future_subscription, None,
                                         self.mock_customer_invoice)
     self.assertEqual(line_item_factory.subscribed_domains, [])
 def test_preexisting_subscription_is_included(self):
     preexisting_subscription = Subscription.new_domain_subscription(
         account=self.customer_account,
         domain=self.domain.name,
         plan_version=self.customer_plan_version,
         date_start=date(2019, 4, 30),
         date_end=date(2019, 5, 2),
     )
     line_item_factory = LineItemFactory(preexisting_subscription, None,
                                         self.mock_customer_invoice)
     self.assertEqual(line_item_factory.subscribed_domains,
                      [self.domain.name])