Пример #1
0
    def test_leadership_tenure_in_days(self):
        member = MembershipFactory()
        assert not member.leadership_tenure_in_days()

        active_leader = LeadershipFactory()
        assert active_leader.leadership_tenure_in_days() == 365

        inactive_leader = LeadershipFactory(leadership_ended=today - delta)
        assert inactive_leader.leadership_tenure_in_days() == 364
Пример #2
0
    def test_leadership_tenure(self):
        member = MembershipFactory()
        assert not member.leadership_tenure()

        active_leader = LeadershipFactory()
        quirk = active_leader.leadership_tenure().replace(u'\xa0', ' ')
        assert quirk == u'1 year'

        inactive_leader = LeadershipFactory(leadership_ended=today - delta)
        quirk = inactive_leader.leadership_tenure().replace(u'\xa0', ' ')
        assert quirk == u'12 months'
Пример #3
0
    def test_days_before_becoming_leader(self):
        member = MembershipFactory()
        assert not member.days_before_becoming_leader()

        leader = LeadershipFactory()
        assert leader.days_before_becoming_leader() == 0