Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Fix up tests for changing participant_id (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Sep 14, 2012
1 parent 0252ccc commit 0158b06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gittip/networks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def change_participant_id(website, old, suggested):
raise Response(400) # XXX Burned by an Aspen bug. :`-(
# https://github.com/whit537/aspen/issues/102

if suggested in os.listdir(website.www_root):
if website is not None and suggested in os.listdir(website.www_root):
raise Response(400)

if suggested != old:
Expand Down
18 changes: 11 additions & 7 deletions gittip/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@
def create_schema(db):
db.execute(SCHEMA)

GITHUB_USERS = [ ("1775515", "lgtest")
, ("1903357", "lglocktest")
, ("1933953", "gittip-test-0")
, ("1933959", "gittip-test-1")
, ("1933965", "gittip-test-2")
, ("1933967", "gittip-test-3")
]

def populate_db_with_dummy_data(db):
from gittip.networks import github
github.upsert({"id": "1775515", "login": "lgtest"})
github.upsert({"id": "1903357", "login": "lglocktest"})
github.upsert({"id": "1933953", "login": "gittip-test-0"})
github.upsert({"id": "1933959", "login": "gittip-test-1"})
github.upsert({"id": "1933965", "login": "gittip-test-2"})
github.upsert({"id": "1933967", "login": "gittip-test-3"})
from gittip.networks import github, change_participant_id
for user_id, login in GITHUB_USERS:
participant_id, a,b,c = github.upsert({"id": user_id, "login": login})
change_participant_id(None, participant_id, login)


class GittipBaseTest(unittest.TestCase):
Expand Down

0 comments on commit 0158b06

Please sign in to comment.