test_submitWebsiteModify

This commit is contained in:
Usman Nasir
2019-11-20 15:18:36 +05:00
parent 3d3c8394ab
commit 3a55c9bf0c

View File

@@ -52,6 +52,43 @@ class TestWebsiteManagement(TestCase):
self.assertEqual(exists, 1)
data_ret = {'domainName': 'hey.cyberpanel.xyz', 'adminEmail': 'usman@cyberpersons.com',
'phpSelection': 'PHP 7.1',
'package': 'Default', 'websiteOwner': 'admin', 'ssl': 0, 'dkimCheck': 0, 'openBasedir': 0}
self.MakeRequest('websites/submitWebsiteCreation', data_ret)
def test_submitWebsiteModify(self):
## Login
data_ret = {'domain': 'hey.cyberpanel.xyz', 'email': 'usman@cyberpersons.com' , 'phpVersion': 'PHP 7.3',
'packForWeb': 'Default', 'admin': 'admin'}
response = self.MakeRequest('websites/saveWebsiteChanges', data_ret)
logging.writeToFile(response['error_message'])
time.sleep(5)
self.assertEqual(response['status'], 1)
phpInfoPath = '/home/hey.cyberpanel.xyz/public_html/info.php'
content = """<?php
phpinfo();
?>
"""
writeToFile = open(phpInfoPath, 'w')
writeToFile.write(content)
writeToFile.close()
exists = 0
if self.MakeRequestRaw('http://hey.cyberpanel.xyz/info.php').find('PHP 7.3') > -1:
exists = 1
self.assertEqual(exists, 1)
def test_submitWebsiteDeletion(self):
@@ -65,24 +102,4 @@ class TestWebsiteManagement(TestCase):
self.assertEqual(response['status'], 1)
def test_submitWebsiteModify(self):
## Login
data_ret = {'domainName': 'hello.cyberpanel.xyz', 'adminEmail': 'usman@cyberpersons.com' , 'phpSelection': 'PHP 7.1',
'package': 'Default', 'websiteOwner': 'admin', 'ssl': 0, 'dkimCheck': 0, 'openBasedir': 0}
response = self.MakeRequest('websites/submitWebsiteCreation', data_ret)
time.sleep(10)
self.assertEqual(response['status'], 1)
exists = 0
if self.MakeRequestRaw('http://hello.cyberpanel.xyz').find('CyberPanel') > -1:
exists = 1
self.assertEqual(exists, 1)