def METHOD_NAME(self):
    """
    Rename a key by PUTing a json with "name" set
    """
    name, payload, data = self.create_tsig_key()
    payload = {
        'name': 'mynewkey'
    }
    r = self.session.put(self.url("/api/v1/servers/localhost/tsigkeys/" + data['id']),
                         data=json.dumps(payload))
    self.assertEqual(r.status_code, 200)
    newdata = r.json()
    self.assertEqual(newdata['name'], 'mynewkey')
    # Check if the old key is removed
    r = self.session.get(self.url("/api/v1/servers/localhost/tsigkeys/" + data['id']))
    self.assertEqual(r.status_code, 404, "Old key was not removed!")