def set_up(self): # Let ConsistencyTestCase set up the datastore testing stub. super(TestApiSurveys, 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(), 'metric': Metric.get_table_definition(), 'program': Program.get_table_definition(), 'survey': Survey.get_table_definition(), 'team': Team.get_table_definition(), 'user': User.get_table_definition(), }) self.ep_program = Program.create( name="Engagement Project", label='ep18', active=True, preview_url='foo.com', ) self.ep_program.put()
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()