Commit 66e43d73 authored by Jérome Perrin's avatar Jérome Perrin

authentication_policy: fix display of password expiration date

7a9d47adff (authentication_policy: fix display of password expiration date, 2021-03-25)
was wrong, the date was not properly substituted in the message.
parent 973ffdef
...@@ -738,7 +738,8 @@ class TestAuthenticationPolicy(ERP5TypeTestCase): ...@@ -738,7 +738,8 @@ class TestAuthenticationPolicy(ERP5TypeTestCase):
redirect_url = urlparse.urlparse(response.getHeader("Location")) redirect_url = urlparse.urlparse(response.getHeader("Location"))
self.assertEqual(redirect_url.path, '{}/ERP5Site_viewNewPersonCredentialUpdateDialog'.format(portal.absolute_url_path())) self.assertEqual(redirect_url.path, '{}/ERP5Site_viewNewPersonCredentialUpdateDialog'.format(portal.absolute_url_path()))
redirect_url_params = urlparse.parse_qs(redirect_url.query) redirect_url_params = urlparse.parse_qs(redirect_url.query)
self.assertIn('Your password will expire', redirect_url_params['portal_status_message'][0]) # status message contain the password expiration date
self.assertIn('Your password will expire at 20', redirect_url_params['portal_status_message'][0])
self.assertIn('You are advised to change it as soon as possible', redirect_url_params['portal_status_message'][0]) self.assertIn('You are advised to change it as soon as possible', redirect_url_params['portal_status_message'][0])
# test proper login # test proper login
......
...@@ -32,7 +32,7 @@ if REQUEST.get('is_user_account_password_expired_expire_date'): ...@@ -32,7 +32,7 @@ if REQUEST.get('is_user_account_password_expired_expire_date'):
keep_items={ keep_items={
'cancel_url': url, 'cancel_url': url,
'portal_status_message': translateString( 'portal_status_message': translateString(
'Your password will expire at {date}. ' 'Your password will expire at ${date}. '
'You are advised to change it as soon as possible.', 'You are advised to change it as soon as possible.',
mapping={'date': mapping={'date':
portal.Base_FormatDate( portal.Base_FormatDate(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment