From 26e20ca5713970c2632432d03c3c81f909eb7183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 31 May 2019 10:23:42 +0200 Subject: [PATCH] Fix for now-allowed PATCH on users Commit 0f0a4be4 introduced using PATCH on users to set the username. An old unit test failed, as it checks that PATCH is not allowed (e.g. tests for 405 Method Not Allowed response). --- tests/test_api/test_auth.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/test_api/test_auth.py b/tests/test_api/test_auth.py index b19fda5b..09c13d91 100644 --- a/tests/test_api/test_auth.py +++ b/tests/test_api/test_auth.py @@ -187,16 +187,6 @@ class AuthenticationTests(AbstractPillarTest): db_user = fetch_user() self.assertEqual(['subscriber'], db_user['roles']) - # PATCH should not be allowed. - updated_fields = {'roles': ['admin', 'subscriber', 'demo']} - self.patch('/api/users/%s' % user_id, - json=updated_fields, - auth_token='token', - etag=db_user['_etag'], - expected_status=405) - db_user = fetch_user() - self.assertEqual(['subscriber'], db_user['roles']) - def test_token_expiry(self): """Expired tokens should be deleted from the database."""