|
@@ -509,3 +509,22 @@ class TestValidators(TestCase):
|
|
|
chatroom_url_validator('irc://irc.example.com/#chan')
|
|
|
with self.assertRaises(ValidationError):
|
|
|
chatroom_url_validator('http://#faimaison@irc.geeknode.org')
|
|
|
+
|
|
|
+
|
|
|
+class MembershipFeeTests(TestCase):
|
|
|
+ def test_mandatory_start_date(self):
|
|
|
+ member = Member(first_name='foo', last_name='foo', password='foo', email='foo')
|
|
|
+ member.save()
|
|
|
+
|
|
|
+ # If there is no start_date clean_fields() should raise an
|
|
|
+ # error but not clean().
|
|
|
+ membershipfee = MembershipFee(member=member)
|
|
|
+ self.assertRaises(ValidationError, membershipfee.clean_fields)
|
|
|
+ self.assertIsNone(membershipfee.clean())
|
|
|
+
|
|
|
+ # If there is a start_date, everything is fine.
|
|
|
+ membershipfee = MembershipFee(member=member, start_date=date.today())
|
|
|
+ self.assertIsNone(membershipfee.clean_fields())
|
|
|
+ self.assertIsNone(membershipfee.clean())
|
|
|
+
|
|
|
+ member.delete()
|