From be72d844e43c7217aff5d160805e5d56a3fd7bf5 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Mon, 25 Nov 2019 14:09:06 +0500 Subject: [PATCH] test_submitDomainCreation --- websiteFunctions/tests.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/websiteFunctions/tests.py b/websiteFunctions/tests.py index 9979607df..2fbefb02a 100755 --- a/websiteFunctions/tests.py +++ b/websiteFunctions/tests.py @@ -479,6 +479,40 @@ phpinfo(); self.assertEqual(exists, 0) + def test_submitDomainCreation(self): + + ## Check creation + + data_ret = {'masterDomain': 'cyberpanel.xyz', 'domainName': 'child.cyberpanel.xyz' , 'phpSelection': 'PHP 7.1', 'ssl': 0, 'dkimCheck': 0, 'openBasedir': 0, 'path': ''} + response = self.MakeRequest('websites/submitDomainCreation', data_ret) + + time.sleep(10) + + self.assertEqual(response['status'], 1) + + exists = 0 + + if self.MakeRequestRaw('http://child.cyberpanel.xyz').find('CyberPanel') > -1: + exists = 1 + + self.assertEqual(exists, 1) + + ## Check deletion + + data_ret = {'websiteName': 'child.cyberpanel.xyz'} + response = self.MakeRequest('websites/submitDomainDeletion', data_ret) + + time.sleep(10) + + self.assertEqual(response['status'], 1) + + exists = 0 + + if self.MakeRequestRaw('http://child.cyberpanel.xyz').find('404') > -1: + exists = 1 + + self.assertEqual(exists, 1) +