def set_up(self):
        """Clear relevant tables from testing SQL database."""
        # Let ConsistencyTestCase set up the datastore testing stub.
        super(TestGraphQLProjectCohort, self).set_up()

        with mysql_connection.connect() as sql:
            sql.reset({
                'checkpoint': Checkpoint.get_table_definition(),
            })

        Program.mock_program_config(
            self.program_label, {
                'name': self.program_name,
                'default_portal_type': 'name_or_id',
                'description': self.program_description,
                'cohorts': {
                    self.cohort_label: self.cohort
                }
            })

        application = webapp2.WSGIApplication(api_routes,
                                              config={
                                                  'webapp2_extras.sessions': {
                                                      'secret_key':
                                                      self.cookie_key
                                                  }
                                              },
                                              debug=True)
        self.testapp = webtest.TestApp(application)
Пример #2
0
 def set_up(self):
     """Clear relevant tables from testing SQL database."""
     # Let ConsistencyTestCase set up the datastore testing stub.
     super(TestSqlModel, self).set_up()
     with mysql_connection.connect() as sql:
         sql.reset({
             'checkpoint':
             Checkpoint.get_table_definition(),
             'participant_data':
             ParticipantData.get_table_definition(),
         })
Пример #3
0
    def set_up(self):
        """Clear relevant tables from testing SQL database."""
        super(TestTaskReminder, self).set_up()
        with mysql_connection.connect() as sql:
            sql.reset({'checkpoint': Checkpoint.get_table_definition()})

        application = webapp2.WSGIApplication(api_routes,
                                              config={
                                                  'webapp2_extras.sessions': {
                                                      'secret_key':
                                                      self.cookie_key
                                                  }
                                              },
                                              debug=True)
        self.testapp = webtest.TestApp(application)
Пример #4
0
    def set_up(self):
        # Let ConsistencyTestCase set up the datastore testing stub.
        super(TestApiTask, self).set_up()

        with mysql_connection.connect() as sql:
            sql.reset({'checkpoint': Checkpoint.get_table_definition()})

        application = webapp2.WSGIApplication(api_routes,
                                              config={
                                                  'webapp2_extras.sessions': {
                                                      'secret_key':
                                                      self.cookie_key
                                                  }
                                              },
                                              debug=True)
        self.testapp = webtest.TestApp(application)
    def set_up(self):
        # Let ConsistencyTestCase set up the datastore testing stub.
        super(TestApiPermissions, self).set_up()

        with mysql_connection.connect() as sql:
            sql.reset({'checkpoint': Checkpoint.get_table_definition()})

        application = webapp2.WSGIApplication(api_routes,
                                              config={
                                                  'webapp2_extras.sessions': {
                                                      'secret_key':
                                                      self.cookie_key
                                                  }
                                              },
                                              debug=True)
        self.testapp = webtest.TestApp(application)

        # Tone down the intense number of hashing rounds for passwords so our
        # unit tests are fast.
        User.password_hashing_context.update(
            sha512_crypt__default_rounds=1000,
            sha256_crypt__default_rounds=1000,
        )
Пример #6
0
 def set_up(self):
     """Clear relevant tables from testing SQL database."""
     # Let ConsistencyTestCase set up the datastore testing stub.
     super(TestProject, self).set_up()
     with mysql_connection.connect() as sql:
         sql.reset({'checkpoint': Checkpoint.get_table_definition()})
Пример #7
0
 def set_up(self):
     """Clear relevant tables from testing SQL database."""
     super(TestTask, self).set_up()
     with mysql_connection.connect() as sql:
         sql.reset({'checkpoint': Checkpoint.get_table_definition()})