def METHOD_NAME(self):
    payload = {
        'name': unique_tsigkey_name(),
        'algorithm': 'foobar'
    }
    r = self.session.post(self.url("/api/v1/servers/localhost/tsigkeys"),
                          headers={'accept': 'application/json'},
                          data=json.dumps(payload))
    self.assertEqual(r.status_code, 400)
    data = r.json()
    self.assertIn('Invalid TSIG algorithm: ', data['error'])