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(TestApiParticipation, self).set_up() application = webapp2.WSGIApplication(api_routes, config={ 'webapp2_extras.sessions': { 'secret_key': self.cookie_key } }, debug=True) self.testapp = webtest.TestApp(application) # Successful download of completion ids triggers a notification, which # requires a cohort name. Program.mock_program_config( self.program_label, {'cohorts': { self.cohort_label: { 'name': self.cohort_label } }}, ) with mysql_connection.connect() as sql: sql.reset({ 'participant': Participant.get_table_definition(), 'participant_data': ParticipantData.get_table_definition(), })
def set_up(self): super(TestParticipants, self).set_up() with mysql_connection.connect() as sql: sql.reset({ 'participant': Participant.get_table_definition(), })
def set_up(self): """Clear relevant tables from testing SQL database.""" # Let ConsistencyTestCase set up the datastore testing stub. super(TestParticipation, self).set_up() with mysql_connection.connect() as sql: sql.reset({ 'participant': Participant.get_table_definition(), 'participant_data': ParticipantData.get_table_definition(), })
def set_up(self): # Let ConsistencyTestCase set up the datastore testing stub. super(TestApiParticipant, self).set_up() with mysql_connection.connect() as sql: sql.reset({ 'participant': Participant.get_table_definition(), 'participant_data': ParticipantData.get_table_definition(), }) application = webapp2.WSGIApplication( api_routes, config={ 'webapp2_extras.sessions': { 'secret_key': self.cookie_key } }, debug=True ) self.testapp = webtest.TestApp(application)