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

30 lines
921 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
#
2024-01-01 02:43:48 -06:00
# Copyright (C) 2013 - 2024, 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.assertIn('Password Change', response.data.decode('utf-8'))
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.assertIn(self.respdata, response.data.decode('utf-8'))