|
|
|
@ -100,35 +100,6 @@ class VenteModelTests(TestCase): |
|
|
|
self.assertEqual(end_memb.month, expected_end.month) |
|
|
|
self.assertEqual(end_memb.year, expected_end.year) |
|
|
|
|
|
|
|
def test_date_start_cotisation(self): |
|
|
|
""" |
|
|
|
It should be possible to add a cotisation with a specific start date |
|
|
|
""" |
|
|
|
v = Vente( |
|
|
|
facture=self.f, |
|
|
|
number=1, |
|
|
|
name="Test purchase", |
|
|
|
duration_connection=0, |
|
|
|
duration_days_connection=1, |
|
|
|
duration_membership=0, |
|
|
|
duration_days_membership=1, |
|
|
|
prix=0, |
|
|
|
) |
|
|
|
v.save() |
|
|
|
v.create_cotis( |
|
|
|
date_start_con=timezone.make_aware(datetime.datetime(1998, 10, 16)), |
|
|
|
date_start_memb=timezone.make_aware(datetime.datetime(1998, 10, 16)), |
|
|
|
) |
|
|
|
v.save() |
|
|
|
self.assertEqual( |
|
|
|
v.cotisation.date_end_con, |
|
|
|
timezone.make_aware(datetime.datetime(1998, 10, 17)), |
|
|
|
) |
|
|
|
self.assertEqual( |
|
|
|
v.cotisation.date_end_memb, |
|
|
|
timezone.make_aware(datetime.datetime(1998, 10, 17)), |
|
|
|
) |
|
|
|
|
|
|
|
def test_one_day_cotisation_membership_only(self): |
|
|
|
""" |
|
|
|
It should be possible to have one day membership without connection. |
|
|
|
@ -215,35 +186,6 @@ class VenteModelTests(TestCase): |
|
|
|
self.assertEqual(end_memb.month, expected_end.month) |
|
|
|
self.assertEqual(end_memb.year, expected_end.year) |
|
|
|
|
|
|
|
def test_date_start_cotisation_membership_only(self): |
|
|
|
""" |
|
|
|
It should be possible to add a cotisation with a specific start date |
|
|
|
""" |
|
|
|
v = Vente( |
|
|
|
facture=self.f, |
|
|
|
number=1, |
|
|
|
name="Test purchase", |
|
|
|
duration_connection=0, |
|
|
|
duration_days_connection=0, |
|
|
|
duration_membership=0, |
|
|
|
duration_days_membership=1, |
|
|
|
prix=0, |
|
|
|
) |
|
|
|
v.save() |
|
|
|
v.create_cotis( |
|
|
|
date_start_con=timezone.make_aware(datetime.datetime(1998, 10, 16)), |
|
|
|
date_start_memb=timezone.make_aware(datetime.datetime(1998, 10, 16)), |
|
|
|
) |
|
|
|
v.save() |
|
|
|
self.assertEqual( |
|
|
|
v.cotisation.date_end_con, |
|
|
|
timezone.make_aware(datetime.datetime(1998, 10, 17)), |
|
|
|
) |
|
|
|
self.assertEqual( |
|
|
|
v.cotisation.date_end_memb, |
|
|
|
timezone.make_aware(datetime.datetime(1998, 10, 16)), |
|
|
|
) |
|
|
|
|
|
|
|
def test_cotisation_membership_diff_connection(self): |
|
|
|
""" |
|
|
|
It should be possible to have purchase a membership longer |
|
|
|
|