예제 #1
0
def test_update_amount():
    user = '******'
    amount = 8

    r = api.put(issue_path + '/sponsorship/%s' % user, amount=amount)
    eq_(r.status_code, 200)
    r = api.get(issue_path + "/sponsorships")
    eq_(r.status_code, 200)
    sponsorships = r.json()
    eq_(len(sponsorships), 2)
    sponsorship = to_object(sponsorships[user])
    eq_(sponsorship.amount, amount) 
    eq_(SponsorshipStatus.from_string(sponsorship.status), 
            SponsorshipStatus.PLEDGED) 
예제 #2
0
def test_update_amount():
    user = '******'
    amount = 8

    r = api.put(issue_path + '/sponsorship/%s' % user, amount=amount)
    eq_(r.status_code, 200)
    r = api.get(issue_path + "/sponsorships")
    eq_(r.status_code, 200)
    sponsorships = r.json()
    eq_(len(sponsorships), 2)
    sponsorship = to_object(sponsorships[user])
    eq_(sponsorship.amount, amount)
    eq_(SponsorshipStatus.from_string(sponsorship.status),
        SponsorshipStatus.PLEDGED)
예제 #3
0
def test_sponsor_issue_2():
    user = '******'
    amount = 5
    
    r = api.post(issue_path + '/sponsorships', user=user, amount=amount)
    eq_(r.status_code, 200)
    r = api.get(issue_path + "/sponsorships")
    eq_(r.status_code, 200)
    sponsorships = r.json()
    eq_(len(sponsorships), 2)
    sponsorship = to_object(sponsorships[user])
    eq_(sponsorship.amount, amount) 
    eq_(SponsorshipStatus.from_string(sponsorship.status), 
            SponsorshipStatus.PLEDGED) 
예제 #4
0
def test_sponsor_issue_2():
    user = '******'
    amount = 5

    r = api.post(issue_path + '/sponsorships', user=user, amount=amount)
    eq_(r.status_code, 200)
    r = api.get(issue_path + "/sponsorships")
    eq_(r.status_code, 200)
    sponsorships = r.json()
    eq_(len(sponsorships), 2)
    sponsorship = to_object(sponsorships[user])
    eq_(sponsorship.amount, amount)
    eq_(SponsorshipStatus.from_string(sponsorship.status),
        SponsorshipStatus.PLEDGED)