stages/user_write: fix unittests

This commit is contained in:
Jens Langhammer 2020-09-18 18:52:19 +02:00
parent 60739e620e
commit dfe093b2b9
2 changed files with 2 additions and 2 deletions

View file

@ -60,7 +60,7 @@ class UserWriteStageView(StageView):
if not key.startswith("attribute_"):
LOGGER.debug("discarding key", key=key)
continue
user.attributes[key] = value
user.attributes[key.replace("attribute_", "", 1)] = value
user.save()
user_write.send(sender=self, request=request, user=user, data=data)
# Check if the password has been updated, and update the session auth hash

View file

@ -86,7 +86,7 @@ class TestUserWriteStage(TestCase):
plan.context[PLAN_CONTEXT_PROMPT] = {
"username": "test-user-new",
"password": new_password,
"some-custom-attribute": "test",
"attribute_some-custom-attribute": "test",
}
session = self.client.session
session[SESSION_KEY_PLAN] = plan