Example #1
0
    def test_release_bounty_to_public_is_successful():
        now = timezone.now()
        profile = Profile(
            handle='foo',
        )
        bounty = Bounty(
            title='ReleaseToPublicTrueTest',
            idx_status='reserved',
            is_open=True,
            web3_created=now,
            expires_date=now + timezone.timedelta(minutes=2),
            bounty_reserved_for_user=profile,
            reserved_for_user_from=now,
            reserved_for_user_expiration=now + timezone.timedelta(minutes=2),
            github_url='https://github.com/gitcoinco/web/issues/12345678',
            raw_data={}
        )

        assert bounty.bounty_reserved_for_user is not None
        assert bounty.reserved_for_user_from is not None
        assert bounty.reserved_for_user_expiration is not None

        assert release_bounty_to_the_public(bounty, False) is True

        assert bounty.bounty_reserved_for_user is None
        assert bounty.reserved_for_user_from is None
        assert bounty.reserved_for_user_expiration is None
Example #2
0
 def test_release_bounty_to_public_fails_when_bounty_is_none():
     assert release_bounty_to_the_public(None) is False