Commit 36fed2fe authored by Och's avatar Och
Browse files

subscription: Fixed broken tests after subscription modification

parent 4744a756
Pipeline #2207 failed with stage
in 31 minutes and 33 seconds
......@@ -497,7 +497,7 @@ SITH_SUBSCRIPTIONS = {
"price": 0,
"duration": 1,
},
"un-mois-essai": {"name": _("One month for free"), "price": 0, "duration": 0.16},
"un-mois-essai": {"name": _("One month for free"), "price": 0, "duration": 0.16666},
"benevoles-euroks": {"name": _("Eurok's volunteer"), "price": 5, "duration": 0.1},
"un-jour": {"name": _("One day"), "price": 0, "duration": 0.00555333},
"membre-staff-ga": {"name": _("GA staff member"), "price": 1, "duration": 0.076},
......
......@@ -137,7 +137,7 @@ class Subscription(models.Model):
"sbarro/esta": 9,
"cursus-alternant": 10,
"welcome-semestre": 11,
"deux-mois-essai": 12,
"un-mois-essai": 12,
}
PAYMENT = {
"CHECK": 1,
......
......@@ -118,11 +118,11 @@ class SubscriptionIntegrationTest(TestCase):
s = Subscription(
member=User.objects.filter(pk=self.user.pk).first(),
subscription_type='un-mois-essai',
subscription_type="un-mois-essai",
payment_method=settings.SITH_SUBSCRIPTION_PAYMENT_METHOD[0],
)
s.subscription_start = date(2017, 8, 29)
s.subscription_end = s.compute_end(duration=0.16, start=s.subscription_start)
s.subscription_end = s.compute_end(duration=0.16666, start=s.subscription_start)
s.save()
self.assertTrue(s.subscription_end == date(2017, 9, 29))
......@@ -208,7 +208,7 @@ class SubscriptionIntegrationTest(TestCase):
duration=settings.SITH_SUBSCRIPTIONS["deux-semestres"]["duration"],
user=user,
)
self.assertTrue(d == date(2016, 10, 29))
self.assertTrue(d == date(2016, 9, 29))
@mock.patch("subscription.models.date", FakeDate)
def test_dates_renewal_sliding_after_one_free_month(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment