def METHOD_NAME(self):
    # create alert
    response = self.client.post('/alert', json=self.critical_alert, headers=self.headers)
    self.assertEqual(response.status_code, 201)
    data = json.loads(response.data.decode('utf-8'))
    alert_id = data['id']
    # ack alert
    payload = {
        'action': 'ack',
        'text': 'ack the alert'
    }
    response = self.client.put('/alert/' + alert_id + '/action', json=payload, headers=self.headers)
    self.assertEqual(response.status_code, 200)
    response = self.client.get('/alert/' + alert_id, headers=self.headers)
    self.assertEqual(response.status_code, 200)
    data = json.loads(response.data.decode('utf-8'))
    self.assertEqual(data['alert']['attributes']['acked-by'], 'admin@alerta.io')
    # clear alert
    response = self.client.post('/alert', json=self.ok_alert, headers=self.headers)
    self.assertEqual(response.status_code, 201)
    data = json.loads(response.data.decode('utf-8'))
    self.assertEqual(data['alert']['severity'], 'ok')
    self.assertEqual(data['alert']['status'], 'closed')
    self.assertEqual(data['alert']['attributes']['acked-by'], 'admin@alerta.io')
    # critical alert (unacked)
    response = self.client.post('/alert', json=self.critical_alert, headers=self.headers)
    self.assertEqual(response.status_code, 201)
    data = json.loads(response.data.decode('utf-8'))
    self.assertEqual(data['alert']['severity'], 'critical')
    self.assertEqual(data['alert']['status'], 'open')
    self.assertNotIn('acked-by', data['alert']['attributes'])
    # ack alert (again)
    payload = {
        'action': 'ack',
        'text': 'ack the alert, again'
    }
    response = self.client.put('/alert/' + alert_id + '/action', json=payload, headers=self.headers)
    self.assertEqual(response.status_code, 200)
    response = self.client.get('/alert/' + alert_id, headers=self.headers)
    self.assertEqual(response.status_code, 200)
    data = json.loads(response.data.decode('utf-8'))
    self.assertEqual(data['alert']['attributes']['acked-by'], 'admin@alerta.io')
    # unack alert
    payload = {
        'action': 'unack',
        'text': 'unack the alert'
    }
    response = self.client.put('/alert/' + alert_id + '/action', json=payload, headers=self.headers)
    self.assertEqual(response.status_code, 200)
    response = self.client.get('/alert/' + alert_id, headers=self.headers)
    self.assertEqual(response.status_code, 200)
    data = json.loads(response.data.decode('utf-8'))
    self.assertNotIn('acked-by', data['alert']['attributes'])