def METHOD_NAME(self):
    test_config = {
        'TESTING': True,
        'AUTH_REQUIRED': True,
        'ADMIN_USERS': ['admin@alerta.io'],
        'ALLOWED_EMAIL_DOMAINS': ['alerta.io', 'doe.com']
    }
    self.app = create_app(test_config)
    self.client = self.app.test_client()
    self.alert = {
        'event': 'Foo',
        'resource': 'Bar',
        'environment': 'Production',
        'service': ['Quux']
    }
    with self.app.test_request_context('/'):
        self.app.preprocess_request()
        self.api_key = ApiKey(
            user='admin@alerta.io',
            scopes=[Scope.admin, Scope.read, Scope.write],
            text='demo-key'
        )
        self.api_key.create()
    self.headers = {
        'Authorization': f'Key {self.api_key.key}',
        'Content-type': 'application/json'
    }