コード例 #1
0
ファイル: test_models.py プロジェクト: hello-base/web
    def test_targeted_is_active(self):
        targeted_active = MembershipFactory()
        assert targeted_active.is_active(target=today)

        targeted_inactive = MembershipFactory(ended=today - delta)
        assert not targeted_inactive.is_active(target=today)

        targeted_upcoming = MembershipFactory(started=today + delta)
        assert not targeted_upcoming.is_active(target=today)
コード例 #2
0
ファイル: test_models.py プロジェクト: hello-base/web
    def test_is_active(self):
        active = MembershipFactory()
        assert active.is_active()

        impending_inactive = MembershipFactory(ended=today + delta)
        assert impending_inactive.is_active()

        inactive = MembershipFactory(ended=today - delta)
        assert not inactive.is_active()