8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 17:36:27 +00:00

Add UT for cotisation order

This commit is contained in:
chapeau 2024-03-02 15:40:22 +01:00
parent 9b3892a1ea
commit 96abac05bf

View file

@ -125,9 +125,13 @@ class NewFactureTests(TestCase):
self.assertEqual(response.status_code, 302)
self.assertEqual(response.url, "/users/profil/%d" % self.user.pk)
invoice = self.user.facture_set.first()
cotisations = invoice.get_subscription()
delta = relativedelta(self.user.end_connexion(), date)
delta.microseconds = 0
self.assertEqual(delta, relativedelta(months=1, days=7))
# Check that the cotisations are sorted
self.assertEqual(relativedelta(cotisations[0].date_end_con, cotisations[0].date_start_con), relativedelta(months=1))
self.assertEqual(relativedelta(cotisations[1].date_end_con, cotisations[1].date_start_con), relativedelta(days=7))
def test_several_articles_creates_several_purchases(self):
data = {