Test case fixes for server mode.

This commit is contained in:
Usman Muzaffar 2018-10-18 09:39:09 +01:00 committed by Dave Page
parent 822d384746
commit 9ae49cbf31
7 changed files with 30 additions and 7 deletions

View File

@ -94,13 +94,13 @@ class ChangePasswordTestCase(BaseTestGenerator):
if 'valid_password' in dir(self):
response = self.tester.post(
'/user_management/user/',
data=dict(
data=json.dumps(dict(
email=self.username,
newPassword=self.password,
confirmPassword=self.password,
active=1,
active=True,
role="2"
),
)),
follow_redirects=True
)
user_id = json.loads(response.data.decode('utf-8'))['id']

View File

@ -43,6 +43,10 @@ class TestLoginUserImage(BaseTestGenerator):
"Logout first if already logged in"
utils.logout_tester_account(cls.tester)
# No need to call baseclass setup function
def setUp(self):
pass
def runTest(self):
# Login and check type of image in response
response = self.tester.post(

View File

@ -15,6 +15,7 @@ from pgadmin import create_app
class InternalVersionTestCase(BaseTestGenerator):
"""
This test case verifies application creation with new versions parameters
"""
scenarios = [
('TestCase with INTERNAL_VERSION_PARAM none', dict(
@ -47,12 +48,14 @@ class InternalVersionTestCase(BaseTestGenerator):
self.config_bak = config
def runTest(self):
# assign config file parameters new values
config.APP_VERSION_INT = self.app_version
config.INTERNAL_VERSION_PARAM = self.version_param
config.INTERNAL_VERSION_EXTN = self.version_extn
config.APP_VERSION_PARAM = self.version_param
config.APP_VERSION_EXTN = self.version_extn
version_string = "?{0}={1}".format(config.INTERNAL_VERSION_PARAM,
config.APP_VERSION_INT)
version_string = "?{0}={1}".format(self.version_param,
self.app_version)
# create application
app = create_app()
with app.app_context(), app.test_request_context():
url = url_for(self.endpoint, filename=self.filename)

View File

@ -86,6 +86,10 @@ class LoginTestCase(BaseTestGenerator):
"""
utils.logout_tester_account(cls.tester)
# No need to call base class setup function
def setUp(self):
pass
def runTest(self):
"""This function checks login functionality."""
response = self.tester.post(

View File

@ -28,6 +28,10 @@ class LogoutTest(BaseTestGenerator):
def setUpClass(cls):
pass
# No need to call base class setup function
def setUp(self):
pass
def runTest(self):
"""This function checks the logout functionality."""

View File

@ -42,6 +42,10 @@ class ResetPasswordTestCase(BaseTestGenerator):
def setUpClass(cls):
logout_tester_account(cls.tester)
# No need to call baseclass setup function
def setUp(self):
pass
def runTest(self):
"""This function checks reset password functionality."""

View File

@ -57,6 +57,10 @@ class VersionInRangeTestCase(BaseTestGenerator):
def setUpClass(cls):
pass
# No need to call base class setup function
def setUp(self):
pass
def runTest(self):
"""This function will check version in range functionality."""
if self.scenario == 1: