diff --git a/websiteFunctions/tests.py b/websiteFunctions/tests.py index c3f21666b..f07bdc925 100755 --- a/websiteFunctions/tests.py +++ b/websiteFunctions/tests.py @@ -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 = """ +""" + 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) - -