def METHOD_NAME(self):
    name, payload, data = self.create_tsig_key()
    payload = {
        'algorithm': 'foobar'
    }
    r = self.session.put(self.url("/api/v1/servers/localhost/tsigkeys/" + data['id']),
                         data=json.dumps(payload))
    self.assertEqual(r.status_code, 422)
    data = r.json()
    self.assertIn('Unknown TSIG algorithm: ', data['error'])