def setUp(self):
     self.app = app.test_client()
     self.headers = {
         'Accept': 'application/json',
         'Content-Type': 'application/json'
     }
     self.approve_body = {"staff_id": "test staff"}
     self.decline_body = {
         "staff_id": "test staff",
         "reason": "Company failed"
     }
     self.close_body = {
         "staff_id": "test staff",
         "requester": "hmlr",
         "close_detail": "A test reason for closing account"
     }
     self.return_true_body = {
         'case_id': 1,
         'staff_id': 'test staff',
         'status_updated': True
     }
     self.return_false_body = {
         'case_id': 1,
         'staff_id': 'test staff',
         'status_updated': False
     }
     self.test_error = ('verification_api', 'VERIFICATION_ERROR',
                        'TEST ERROR')
 def setUp(self):
     self.app = app.test_client()
     self.error = ProgrammingError('stuff failed', 'Program', 'Error')
     self.dataset_activity = [{
         'private': True,
         'name': 'nps',
         'licence_agreed': True
     }]
Example #3
0
 def setUp(self):
     with app.app_context():
         self.app = app.test_client()
         self.url = current_app.config["ACCOUNT_API_URL"]
         self.version = current_app.config["ACCOUNT_API_VERSION"]
         self.timeout = current_app.config["DEFAULT_TIMEOUT"]
         self.error_msg = 'Test error message'
         self.key = current_app.config['MASTER_API_KEY']
 def setUp(self):
     with app.app_context():
         self.app = app.test_client()
         self.url = current_app.config["ULAPD_API_URL"]
         self.timeout = current_app.config["DEFAULT_TIMEOUT"]
         self.error_msg = 'Test error message'
         self.updated_data = {'user_id': '123', 'contactable': True}
         self.headers = {
             "Content-Type": "application/json",
             "Accept": "application/json"
         }
 def setUp(self):
     with app.app_context():
         self.app = app.test_client()
         self.url = current_app.config["METRIC_API_URL"]
         self.timeout = current_app.config["DEFAULT_TIMEOUT"]
         self.error_msg = "Test error"
         self.payload = {
             'registration_data': {
                 'user_id': '123-456-abc',
                 'status': 'Pending',
                 'user_type': 'organisation-uk'
             }
         }
    def setUp(self):
        self.client = app.test_client()

        with app.app_context():
            self.headers = {'Accept': 'application/json',
                            'Content-Type': 'application/json',
                            'Authorization': 'Bearer ' + current_app.config['MASTER_API_KEY']}

        self.ldap_id, self.ulapd_id, self.case_id = (None,) * 3
        self.skip_test = False
        try:
            app.logger.info('Setting up service user...')
            self._setup_service_user()
            app.logger.info('Done.')

            app.logger.info('Setting up DST case...')
            self.case_id = helpers.insert_dst_case(self.case_data)
            app.logger.info('Done.'.format(self.case_id))
        except Exception:
            self.skip_test = True
            app.logger.error('Setup failed, skipping test')
            traceback.print_exc()
            self.tearDown()
Example #7
0
 def setUp(self):
     self.app = app.test_client()