mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Add UT for cotisation order
This commit is contained in:
parent
9b3892a1ea
commit
96abac05bf
1 changed files with 4 additions and 0 deletions
|
@ -125,9 +125,13 @@ class NewFactureTests(TestCase):
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
self.assertEqual(response.url, "/users/profil/%d" % self.user.pk)
|
self.assertEqual(response.url, "/users/profil/%d" % self.user.pk)
|
||||||
invoice = self.user.facture_set.first()
|
invoice = self.user.facture_set.first()
|
||||||
|
cotisations = invoice.get_subscription()
|
||||||
delta = relativedelta(self.user.end_connexion(), date)
|
delta = relativedelta(self.user.end_connexion(), date)
|
||||||
delta.microseconds = 0
|
delta.microseconds = 0
|
||||||
self.assertEqual(delta, relativedelta(months=1, days=7))
|
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):
|
def test_several_articles_creates_several_purchases(self):
|
||||||
data = {
|
data = {
|
||||||
|
|
Loading…
Reference in a new issue