Skip to content

Commit

Permalink
fix: add zope.wsgi fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed May 3, 2023
1 parent 61362b1 commit 9886068
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .installed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion src/collective/taxonomy/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down
4 changes: 1 addition & 3 deletions src/collective/taxonomy/tests/test_taxonomy_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 9886068

Please sign in to comment.