From 988606817db9a90fdaaa76f21d9c4a60d93f827a Mon Sep 17 00:00:00 2001 From: nileshgulia1 Date: Wed, 3 May 2023 14:56:17 +0530 Subject: [PATCH] fix: add zope.wsgi fixture --- .installed.txt | 7 ++++++- requirements.txt | 3 +++ src/collective/taxonomy/testing.py | 4 +++- src/collective/taxonomy/tests/test_taxonomy_endpoint.py | 4 +--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.installed.txt b/.installed.txt index 2b24706..39fe95c 100644 --- a/.installed.txt +++ b/.installed.txt @@ -12,9 +12,11 @@ BTrees==5.0 certifi==2022.12.7 cffi==1.15.1 Chameleon==3.10.2 +charset-normalizer==3.0.1 click==8.1.3 +collective.MockMailHost==2.0.0 collective.monkeypatcher==1.2.1 --e git+https://github.com/collective/collective.taxonomy.git@fcc13e5d6d1e5858eb9200d489d80db4356bc7c4#egg=collective.taxonomy +-e git+https://github.com/collective/collective.taxonomy.git@61362b10e7a72c71b58a26b96c099483e16fa52b#egg=collective.taxonomy cryptography==40.0.2 cssselect==1.2.0 DateTime==5.1 @@ -72,6 +74,7 @@ plone.app.discussion==4.0.1 plone.app.event==5.0.1 plone.app.i18n==4.0.1 plone.app.intid==2.0.0 +plone.app.iterate==5.0.2 plone.app.layout==4.0.3 plone.app.linkintegrity==4.0.1 plone.app.locales==6.0.13 @@ -145,6 +148,7 @@ Products.CMFCore==2.7.0 Products.CMFDiffTool==4.0.1 Products.CMFDynamicViewFTI==7.0.1 Products.CMFEditions==4.0.1 +Products.CMFPlacefulWorkflow==3.0.3 Products.CMFPlone==6.0.4 Products.CMFUid==4.0 Products.DateRecurringIndex==3.0.1 @@ -179,6 +183,7 @@ python-gettext==4.1 pytz==2022.7.1 Record==3.6 repoze.xmliter==0.6.1 +requests==2.28.2 RestrictedPython==6.0 robotframework==5.0.1 robotframework-debuglibrary==2.3.0 diff --git a/requirements.txt b/requirements.txt index 8d7c116..5dab12f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,6 @@ # WSGI: A system for configuration of WSGI web components in declarative .ini format. Paste pdbpp +plone.app.iterate +requests +collective.MockMailHost diff --git a/src/collective/taxonomy/testing.py b/src/collective/taxonomy/testing.py index 7932601..55c40b8 100644 --- a/src/collective/taxonomy/testing.py +++ b/src/collective/taxonomy/testing.py @@ -6,6 +6,7 @@ from plone.app.testing import PLONE_FIXTURE from plone.app.testing import PloneSandboxLayer from plone.testing import z2 +from plone.testing import zope import collective.taxonomy @@ -35,7 +36,8 @@ def setUpPloneSite(self, portal): ) FUNCTIONAL_TESTING = FunctionalTesting( - bases=(COLLECTIVE_TAXONOMY_FIXTURE,), name="TaxonomyFixture:Functional" + bases=(COLLECTIVE_TAXONOMY_FIXTURE, zope.WSGI_SERVER_FIXTURE), + name="TaxonomyFixture:Functional", ) ROBOT_TESTING = FunctionalTesting( diff --git a/src/collective/taxonomy/tests/test_taxonomy_endpoint.py b/src/collective/taxonomy/tests/test_taxonomy_endpoint.py index df0e33a..25b1562 100644 --- a/src/collective/taxonomy/tests/test_taxonomy_endpoint.py +++ b/src/collective/taxonomy/tests/test_taxonomy_endpoint.py @@ -21,18 +21,16 @@ def setUp(self): self.portal_url = self.portal.absolute_url() setRoles(self.portal, TEST_USER_ID, ["Manager"]) - self.api_session = RelativeSession(self.portal_url) + self.api_session = RelativeSession(self.portal_url, test=self) self.api_session.headers.update({"Accept": "application/json"}) self.api_session.auth = (SITE_OWNER_NAME, SITE_OWNER_PASSWORD) self.portal.portal_workflow.setDefaultChain("simple_publication_workflow") applyProfile(self.portal, "plone.app.contenttypes:plone-content") - commit() def test_route_exists(self): response = self.api_session.get("/@taxonomy") - self.assertEqual(response.status_code, 200) def test_get_without_parameters_return_all_taxonomies(self):