def test_when_offering_is_created_total_is_updated(self, scope):
     fixture = support_fixtures.SupportFixture()
     offering = fixture.offering
     offering.state = support_models.Offering.States.OK
     offering.save()
     estimate = models.PriceEstimate.objects.get(scope=getattr(fixture, scope))
     self.assertEqual(estimate.total, offering.unit_price * 31)
Esempio n. 2
0
    def setUp(self):
        self.fixture = support_fixtures.SupportFixture()
        self.start_date = timezone.datetime(2014, 2, 7, tzinfo=pytz.UTC)

        with freeze_time(self.start_date):
            self.offering = self.fixture.offering
            self.offering.state = self.offering.States.OK
            self.offering.save()
            self.assertEqual(models.Invoice.objects.count(), 1)
            self.invoice = models.Invoice.objects.first()
            self.offering.state = self.offering.States.REQUESTED
            self.offering.save()
            self.assertEqual(models.Invoice.objects.count(), 1)
Esempio n. 3
0
 def setUp(self):
     self.fixture = support_fixtures.SupportFixture()