def set_up(self): # Let ConsistencyTestCase set up the datastore testing stub. super(TestApiParticipants, self).set_up() application = self.patch_webapp(webapp2.WSGIApplication)( api_routes, config={ 'webapp2_extras.sessions': { 'secret_key': self.cookie_key } }, debug=True) self.testapp = webtest.TestApp(application) with mysql_connection.connect() as sql: sql.reset({ 'classroom': Classroom.get_table_definition(), 'cycle': Cycle.get_table_definition(), 'participant': Participant.get_table_definition(), 'program': Program.get_table_definition(), 'team': Team.get_table_definition(), 'user': User.get_table_definition(), }) self.program = Program.create( name="Engagement Project", label='ep18', min_cycles=3, active=True, preview_url='foo.com', ) self.program.put()
def set_up(self): # Let ConsistencyTestCase set up the datastore testing stub. super(TestCycles, self).set_up() with mysql_connection.connect() as sql: sql.reset({ 'classroom': Classroom.get_table_definition(), 'cycle': Cycle.get_table_definition(), 'program': Program.get_table_definition(), 'team': Team.get_table_definition(), 'user': User.get_table_definition(), })
def set_up(self): # Let ConsistencyTestCase set up the datastore testing stub. super(TestSurveys, self).set_up() with mysql_connection.connect() as sql: sql.reset({ 'cycle': Cycle.get_table_definition(), 'metric': Metric.get_table_definition(), 'program': Program.get_table_definition(), 'survey': Survey.get_table_definition(), 'team': Team.get_table_definition(), })
def set_up(self): # Let ConsistencyTestCase set up the datastore testing stub. super(TestApiTeams, self).set_up() application = webapp2.WSGIApplication( api_routes, config={ 'webapp2_extras.sessions': { 'secret_key': self.cookie_key } }, debug=True ) self.testapp = webtest.TestApp(application) with mysql_connection.connect() as sql: sql.reset({ 'classroom': Classroom.get_table_definition(), 'cycle': Cycle.get_table_definition(), 'program': Program.get_table_definition(), 'organization': Organization.get_table_definition(), 'report': Report.get_table_definition(), 'survey': Survey.get_table_definition(), 'team': Team.get_table_definition(), 'user': User.get_table_definition(), }) # See #848. Remove once resolved. self.demo_program = Program.create( name="Demo Program", label='demoprogram', min_cycles=3, active=True, preview_url='foo.com', ) self.demo_program.put() self.ep_program = Program.create( name="Engagement Project", label='ep19', min_cycles=3, active=True, preview_url='foo.com', ) self.ep_program.put()
def set_up(self): # Let ConsistencyTestCase set up the datastore testing stub. super(TestApiOrganizations, self).set_up() application = webapp2.WSGIApplication(api_routes, config={ 'webapp2_extras.sessions': { 'secret_key': self.cookie_key } }, debug=True) self.testapp = webtest.TestApp(application) with mysql_connection.connect() as sql: sql.reset({ 'cycle': Cycle.get_table_definition(), 'organization': Organization.get_table_definition(), 'program': Program.get_table_definition(), 'response': Response.get_table_definition(), 'team': Team.get_table_definition(), 'user': User.get_table_definition(), }) self.program = Program.create( name="Engagement Project", label='ep18', min_cycles=3, active=True, preview_url='foo.com', ) self.program.put() self.beleset_program = Program.create( name="Copilot-Elevate", label='beleset19', min_cycles=2, active=True, preview_url='foo.com', ) self.beleset_program.put()
def set_up(self): # Let ConsistencyTestCase set up the datastore testing stub. super(TestApiCycles, self).set_up() application = webapp2.WSGIApplication( api_routes, config={ 'webapp2_extras.sessions': { 'secret_key': self.cookie_key } }, debug=True ) self.testapp = webtest.TestApp(application) with mysql_connection.connect() as sql: sql.reset({ 'cycle': Cycle.get_table_definition(), 'program': Program.get_table_definition(), 'team': Team.get_table_definition(), 'user': User.get_table_definition(), })