From 977d3f6ef9de4a0195f4d9fd0b31a8f60ff9aa24 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 13 Dec 2020 20:38:43 +0100 Subject: [PATCH] stages/user_write: add test that attributes without prefix are ignored --- authentik/stages/user_write/tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/authentik/stages/user_write/tests.py b/authentik/stages/user_write/tests.py index 43f1bd1fe..65eb01b9a 100644 --- a/authentik/stages/user_write/tests.py +++ b/authentik/stages/user_write/tests.py @@ -87,6 +87,7 @@ class TestUserWriteStage(TestCase): "username": "test-user-new", "password": new_password, "attribute_some-custom-attribute": "test", + "some_ignored_attribute": "bar" } session = self.client.session session[SESSION_KEY_PLAN] = plan @@ -109,6 +110,7 @@ class TestUserWriteStage(TestCase): self.assertTrue(user_qs.exists()) self.assertTrue(user_qs.first().check_password(new_password)) self.assertEqual(user_qs.first().attributes["some-custom-attribute"], "test") + self.assertNotIn("some_ignored_attribute", user_qs.first().attributes) @patch( "authentik.flows.views.to_stage_response",