Ejemplo n.º 1
0
    def test_default_expiry_expiry_disabled(self):
        new_member = Member(name="New Member")
        new_member.save()

        new_member.refresh_from_db()
        self.assertIsNone(new_member.membership_expires)
        self.assertFalse(new_member.has_expired())
Ejemplo n.º 2
0
    def test_default_expiry_expiry_disabled(self):
        new_member = Member(name="New Member")
        new_member.save()

        new_member.refresh_from_db()
        self.assertIsNone(new_member.membership_expires)
        self.assertFalse(new_member.has_expired())
Ejemplo n.º 3
0
    def test_default_expiry_expiry_enabled(self, now_mock):
        now_mock.return_value.date.return_value = \
            datetime.date(day=1, month=1, year=2000)

        new_member = Member(name="New Member")
        new_member.save()

        new_member.refresh_from_db()
        self.assertEqual(new_member.membership_expires,
                         datetime.date(2000, 4, 10))
        self.assertFalse(new_member.has_expired())
Ejemplo n.º 4
0
    def test_default_expiry_expiry_enabled(self, now_mock):
        now_mock.return_value.date.return_value = \
            datetime.date(day=1, month=1, year=2000)

        new_member = Member(name="New Member")
        new_member.save()

        new_member.refresh_from_db()
        self.assertEqual(new_member.membership_expires,
                         datetime.date(2000, 4, 10))
        self.assertFalse(new_member.has_expired())