from gratipay.wireup import db, env
from gratipay.models.team import migrate_all_tips

db = db(env())

if __name__ == '__main__':
    migrate_all_tips(db)
 def test_mat_ignores_already_migrated_teams(self):
     capture, captured = self.capturer()
     migrate_all_tips(self.db, capture)
     del captured[:]  # clear first run output
     migrate_all_tips(self.db, capture)
     assert captured == ["Done."]
 def test_mat_ignores_rejected_teams(self):
     self.setTeamStatus('rejected')
     capture, captured = self.capturer()
     migrate_all_tips(self.db, capture)
     assert captured == ["Done."]
 def test_mat_migrates_all_tips(self):
     capture, captured = self.capturer()
     migrate_all_tips(self.db, capture)
     assert captured == ["Migrated 2 tip(s) for 'new_team'", "Done."]