def setUp(self):
        """Perform setup for the testcase."""
        assemble_leaderboards.ranks = default_ranks()
        tip = Tip(emails=['*****@*****.**'],
                  tokenName='USDT',
                  amount=7,
                  username='******',
                  network='net',
                  expires_date=date.today() + timedelta(days=1),
                  tokenAddress='0x0000000000000000000000000000000000000000')
        fulfiller_profile = Profile.objects.create(data={},
                                                   handle='fred',
                                                   email='*****@*****.**')
        bounty = Bounty.objects.create(
            title='foo',
            value_in_token=3,
            token_name='USDT',
            web3_created=datetime(2008, 10, 31),
            github_url='https://github.com/gitcoinco/web',
            token_address='0x0',
            issue_description='hello world',
            bounty_owner_github_username='******',
            is_open=False,
            accepted=True,
            expires_date=datetime(2008, 11, 30),
            idx_project_length=5,
            project_length='Months',
            bounty_type='Feature',
            experience_level='Intermediate',
            raw_data={},
            idx_status='submitted',
            current_bounty=True)
        BountyFulfillment.objects.create(
            fulfiller_address='0x0000000000000000000000000000000000000000',
            fulfiller_email='',
            fulfiller_github_username='******',
            fulfiller_name='Fred',
            bounty=bounty,
            profile=fulfiller_profile,
        )

        self.bounty = bounty
        self.tip = tip
Ejemplo n.º 2
0
    def setUp(self):
        """Perform setup for the testcase."""
        assemble_leaderboards.ranks = default_ranks()

        self.bounty_value = 3
        self.bounty_payer_handle = 'flintstone'
        self.bounty_earner_handle = 'freddy'

        self.bounty_payer_profile = Profile.objects.create(
            data={},
            handle=self.bounty_payer_handle,
            hide_profile=False,
        )
        UserAction.objects.create(
            profile=self.bounty_payer_profile,
            action='Login',
            ip_address='24.210.224.38',
        )
        UserAction.objects.create(
            profile=self.bounty_payer_profile,
            action='Login',
            ip_address='185.86.151.11',
        )
        self.bounty_earner_profile = Profile.objects.create(
            data={},
            handle=self.bounty_earner_handle,
            hide_profile=False,
        )
        UserAction.objects.create(
            profile=self.bounty_earner_profile,
            action='Login',
            ip_address='110.174.165.78',
        )
        self.bounty = Bounty.objects.create(
            title='foo',
            value_in_token=self.bounty_value,
            token_name='USDT',
            web3_created=datetime(2008, 10, 31, tzinfo=UTC),
            github_url='https://github.com/gitcoinco/web',
            token_address='0x0',
            issue_description='hello world',
            bounty_owner_github_username=self.bounty_payer_handle,
            bounty_owner_profile=self.bounty_payer_profile,
            is_open=False,
            accepted=True,
            expires_date=datetime.now(UTC) + timedelta(days=1),
            idx_project_length=5,
            project_length='Months',
            bounty_type='Feature',
            experience_level='Intermediate',
            raw_data={},
            idx_status='submitted',
            current_bounty=True,
            network='mainnet',
            metadata={"issueKeywords": "Python, Shell"},
        )
        self.fulfiller_profile = Profile.objects.create(
            data={},
            handle=self.bounty_earner_handle,
            hide_profile=False,
        )
        BountyFulfillment.objects.create(
            fulfiller_address='0x0000000000000000000000000000000000000000',
            fulfiller_github_username=self.bounty_earner_handle,
            bounty=self.bounty,
            accepted=True,
            profile=self.fulfiller_profile,
        )

        self.tip_value = 7
        self.tip_payer_handle = 'johnny'
        self.tip_earner_handle = 'john'

        self.tip_username_profile = Profile.objects.create(
            data={},
            handle=self.tip_earner_handle,
            hide_profile=False,
        )
        self.tip_from_username_profile = Profile.objects.create(
            data={},
            handle=self.tip_payer_handle,
            hide_profile=False,
        )
        UserAction.objects.create(
            profile=self.tip_username_profile,
            action='Login',
            ip_address='24.210.224.38',
        )
        UserAction.objects.create(
            profile=self.tip_from_username_profile,
            action='Login',
            ip_address='185.86.151.11',
        )
        self.tip = Tip.objects.create(
            emails=['*****@*****.**'],
            tokenName='USDT',
            amount=self.tip_value,
            username=self.tip_earner_handle,
            from_username=self.tip_payer_handle,
            github_url='https://github.com/gitcoinco/web',
            network='mainnet',
            expires_date=datetime.now(UTC) + timedelta(days=1),
            tokenAddress='0x0000000000000000000000000000000000000000',
            txid='123',
        )
Ejemplo n.º 3
0
    def test_default_ranks(self):
        """Test default ranks dictionary."""
        ranks = default_ranks()

        assert len(ranks) == len(TIMES) * len(BREAKDOWNS)