def fake_team(db, teamowner): """Create a fake team """ isapproved = [True, False] productorservice = ['Product','Service'] teamname = faker.first_name() + fake_text_id(3) teamslugname = faker.city() try: #using community.slugize teamslug = community.slugize(teamslugname) _fake_thing( db , "teams" , slug=teamslug , slug_lower=teamslug.lower() , name=teamname , homepage='www.example.org/' + fake_text_id(3) , product_or_service=random.sample(productorservice,1)[0] , getting_involved='build' , getting_paid='paypal' , owner=teamowner.username , is_approved=random.sample(isapproved,1)[0] , receiving=0.1 , nmembers=3 ) except IntegrityError: return fake_team(db, teamowner) return Team.from_slug(teamslug)
def fake_team(db, teamowner): """Create a fake team """ isapproved = [True, False] productorservice = ['Product', 'Service'] teamname = faker.first_name() + fake_text_id(3) teamslugname = faker.city() try: #using community.slugize teamslug = community.slugize(teamslugname) homepage = 'http://www.example.org/' + fake_text_id(3) _fake_thing(db, "teams", slug=teamslug, slug_lower=teamslug.lower(), name=teamname, homepage=homepage, product_or_service=random.sample(productorservice, 1)[0], todo_url=homepage + '/tickets', onboarding_url=homepage + '/contributing', owner=teamowner.username, is_approved=random.sample(isapproved, 1)[0], receiving=0.1, nreceiving_from=3) except IntegrityError: return fake_team(db, teamowner) return Team.from_slug(teamslug)
def fake_team(db, teamowner): """Create a fake team """ isapproved = [True, False] productorservice = ['Product', 'Service'] teamname = faker.first_name() + fake_text_id(3) teamslugname = faker.city() try: #using community.slugize teamslug = community.slugize(teamslugname) _fake_thing(db, "teams", slug=teamslug, slug_lower=teamslug.lower(), name=teamname, homepage='www.example.org/' + fake_text_id(3), product_or_service=random.sample(productorservice, 1)[0], getting_involved='build', getting_paid='paypal', owner=teamowner.username, is_approved=random.sample(isapproved, 1)[0], receiving=0.1, nmembers=3) except IntegrityError: return fake_team(db, teamowner) return Team.from_slug(teamslug)
def fake_team(db, teamowner): """Create a fake team """ isapproved = [True, False] productorservice = ['Product','Service'] teamname = faker.first_name() + fake_text_id(3) teamslugname = faker.city() try: #using community.slugize teamslug = community.slugize(teamslugname) homepage = 'http://www.example.org/' + fake_text_id(3) _fake_thing( db , "teams" , slug=teamslug , slug_lower=teamslug.lower() , name=teamname , homepage=homepage , product_or_service=random.sample(productorservice,1)[0] , todo_url=homepage + '/tickets' , onboarding_url=homepage + '/contributing' , owner=teamowner.username , is_approved=random.sample(isapproved,1)[0] , receiving=0.1 , nreceiving_from=3 ) except IntegrityError: return fake_team(db, teamowner) return Team.from_slug(teamslug)
def fake_community(db, creator): """Create a fake community """ name = faker.city() if not community.name_pattern.match(name): return fake_community(db, creator) slug = community.slugize(name) creator.insert_into_communities(True, name, slug) return community.Community.from_slug(slug)
def add_participant(self, participant_name): participant = self.make_participant(participant_name) participant.insert_into_communities(True, "test", slugize("test")) return participant
def add_participant(self, participant_name): participant = self.make_participant(participant_name) participant.insert_into_communities(True, 'test', slugize('test')) return participant