|
@@ -2,17 +2,17 @@
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
import os
|
|
|
-import logging
|
|
|
+
|
|
|
import ldapdb
|
|
|
from datetime import date
|
|
|
from cStringIO import StringIO
|
|
|
from dateutil.relativedelta import relativedelta
|
|
|
+from freezegun import freeze_time
|
|
|
import unittest
|
|
|
|
|
|
from django import db
|
|
|
from django.conf import settings
|
|
|
-from django.test import TestCase, Client, override_settings
|
|
|
-from django.contrib.auth.models import User
|
|
|
+from django.test import TestCase, Client
|
|
|
from django.core import mail, management
|
|
|
from django.core.exceptions import ValidationError
|
|
|
|
|
@@ -359,6 +359,21 @@ class MemberTests(TestCase):
|
|
|
# de cotisation
|
|
|
self.assertEqual(member.is_paid_up(), True)
|
|
|
|
|
|
+ @freeze_time('2016-01-01')
|
|
|
+ def test_adding_running_fee_set_membership_status(self):
|
|
|
+ member = Member.objects.create(
|
|
|
+ first_name='a', last_name='b', username='c',
|
|
|
+ status=Member.MEMBER_STATUS_PENDING)
|
|
|
+
|
|
|
+ # Créé une cotisation passée
|
|
|
+ MembershipFee.objects.create(
|
|
|
+ member=member, amount=20,
|
|
|
+ start_date=date(2015, 12, 12),
|
|
|
+ end_date=date(2016, 12, 12))
|
|
|
+
|
|
|
+ member = Member.objects.get(pk=member.pk)
|
|
|
+ self.assertEqual(member.status, member.MEMBER_STATUS_MEMBER)
|
|
|
+
|
|
|
def test_member_cant_be_created_without_names(self):
|
|
|
"""
|
|
|
Test qu'un membre ne peut pas être créé sans "noms"
|