2017-03-16 09:27:55 -05:00
|
|
|
##########################################################################
|
2016-08-09 10:05:40 -05:00
|
|
|
#
|
2017-03-16 09:27:55 -05:00
|
|
|
# pgAdmin 4 - PostgreSQL Tools
|
2016-08-09 10:05:40 -05:00
|
|
|
#
|
2020-01-02 08:43:50 -06:00
|
|
|
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
|
2017-03-16 09:27:55 -05:00
|
|
|
# This software is released under the PostgreSQL Licence
|
2016-08-09 10:05:40 -05:00
|
|
|
#
|
2017-03-16 09:27:55 -05:00
|
|
|
##########################################################################
|
2016-08-09 10:05:40 -05:00
|
|
|
|
2018-03-07 05:47:01 -06:00
|
|
|
|
2016-08-09 10:05:40 -05:00
|
|
|
def change_password(self):
|
2018-03-07 05:47:01 -06:00
|
|
|
response = self.tester.get(
|
|
|
|
'/browser/change_password', follow_redirects=True
|
|
|
|
)
|
|
|
|
self.assertTrue(
|
2019-05-28 00:29:51 -05:00
|
|
|
'Password Change' in response.data.decode('utf-8')
|
2018-03-07 05:47:01 -06:00
|
|
|
)
|
2016-08-09 10:05:40 -05:00
|
|
|
|
2019-05-28 00:29:51 -05:00
|
|
|
csrf_token = self.tester.fetch_csrf(response)
|
|
|
|
|
2018-03-07 05:47:01 -06:00
|
|
|
response = self.tester.post(
|
|
|
|
'/browser/change_password',
|
|
|
|
data=dict(
|
|
|
|
password=self.password,
|
|
|
|
new_password=self.new_password,
|
2019-05-28 00:29:51 -05:00
|
|
|
new_password_confirm=self.new_password_confirm,
|
|
|
|
csrf_token=csrf_token,
|
2018-03-07 05:47:01 -06:00
|
|
|
),
|
|
|
|
follow_redirects=True
|
|
|
|
)
|
2016-10-07 07:59:43 -05:00
|
|
|
self.assertTrue(self.respdata in response.data.decode('utf-8'))
|