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