pgadmin4/web/pgadmin/browser/tests/utils.py

32 lines
943 B
Python
Raw Normal View History

2017-03-16 09:27:55 -05:00
##########################################################################
#
2017-03-16 09:27:55 -05:00
# pgAdmin 4 - PostgreSQL Tools
#
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
#
2017-03-16 09:27:55 -05:00
##########################################################################
2018-03-07 05:47:01 -06: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(
'Password Change' in response.data.decode('utf-8')
2018-03-07 05:47:01 -06: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,
new_password_confirm=self.new_password_confirm,
csrf_token=csrf_token,
2018-03-07 05:47:01 -06:00
),
follow_redirects=True
)
self.assertTrue(self.respdata in response.data.decode('utf-8'))