Refactor PHP tests dropping legacy controller (backend)

This commit is contained in:
Santiago L 2021-03-30 13:35:00 +02:00
parent 58395147c9
commit 14fbd98e33
2 changed files with 23 additions and 36 deletions

View File

@ -63,9 +63,9 @@ class StaticWebAppMixin(object):
)
class PHPFcidWebAppMixin(StaticWebAppMixin):
backend = backends.phpfcgid.PHPFcgidBackend
type_value = 'php5.2'
class PHPFPMWebAppMixin(StaticWebAppMixin):
backend = backends.php.PHPController
type_value = 'php5.5'
token = random_ascii(100)
page = (
'index.php',
@ -74,11 +74,6 @@ class PHPFcidWebAppMixin(StaticWebAppMixin):
)
class PHPFPMWebAppMixin(PHPFcidWebAppMixin):
backend = backends.phpfpm.PHPFPMBackend
type_value = 'php5.5'
class RESTWebAppMixin(object):
def setUp(self):
super(RESTWebAppMixin, self).setUp()
@ -120,10 +115,6 @@ class StaticRESTWebAppTest(StaticWebAppMixin, RESTWebAppMixin, WebAppMixin, Base
pass
class PHPFcidRESTWebAppTest(PHPFcidWebAppMixin, RESTWebAppMixin, WebAppMixin, BaseLiveServerTestCase):
pass
class PHPFPMRESTWebAppTest(PHPFPMWebAppMixin, RESTWebAppMixin, WebAppMixin, BaseLiveServerTestCase):
pass

View File

@ -6,7 +6,7 @@ import requests
from orchestra.contrib.domains.models import Domain, Record
from orchestra.contrib.domains.backends import Bind9MasterDomainController
from orchestra.contrib.orchestration.models import Server, Route
from orchestra.contrib.webapps.tests.functional_tests.tests import StaticWebAppMixin, RESTWebAppMixin, WebAppMixin, PHPFcidWebAppMixin, PHPFPMWebAppMixin
from orchestra.contrib.webapps.tests.functional_tests.tests import StaticWebAppMixin, RESTWebAppMixin, WebAppMixin, PHPFPMWebAppMixin
from orchestra.utils.tests import BaseLiveServerTestCase, random_ascii, save_response_on_error
from ... import backends
@ -102,9 +102,9 @@ class StaticRESTWebsiteTest(RESTWebsiteMixin, StaticWebAppMixin, WebsiteMixin, B
self.addCleanup(self.delete_website, website)
self.validate_add_website(website, domain)
self.type_value = PHPFcidWebAppMixin.type_value
self.backend = PHPFcidWebAppMixin.backend
self.page = PHPFcidWebAppMixin.page
self.type_value = PHPFPMWebAppMixin.type_value
self.backend = PHPFPMWebAppMixin.backend
self.page = PHPFPMWebAppMixin.page
self.add_route()
webapp = '%s_%s_webapp' % (random_ascii(10), self.type_value)
self.add_webapp(webapp)
@ -130,10 +130,6 @@ class StaticRESTWebsiteTest(RESTWebsiteMixin, StaticWebAppMixin, WebsiteMixin, B
self.assertEqual(self.page[2], requests.get(url).content)
class PHPFcidRESTWebsiteTest(RESTWebsiteMixin, PHPFcidWebAppMixin, WebsiteMixin, BaseLiveServerTestCase):
pass
class PHPFPMRESTWebsiteTest(RESTWebsiteMixin, PHPFPMWebAppMixin, WebsiteMixin, BaseLiveServerTestCase):
pass