Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico committed Sep 21, 2023
1 parent 856d008 commit 988ec19
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/redturtle/volto/tests/test_catalog_limit_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from plone.app.testing import SITE_OWNER_PASSWORD
from plone.app.testing import TEST_USER_ID
from plone.restapi.testing import RelativeSession
from redturtle.volto.config import MAX_LIMIT
from redturtle.volto.testing import REDTURTLE_VOLTO_API_FUNCTIONAL_TESTING
from transaction import commit
from urllib.parse import quote
Expand All @@ -16,6 +15,7 @@

class CatalogLimitPatches(unittest.TestCase):
layer = REDTURTLE_VOLTO_API_FUNCTIONAL_TESTING
MAX_LIMIT = 500

def setUp(self):
self.app = self.layer["app"]
Expand All @@ -24,7 +24,7 @@ def setUp(self):

setRoles(self.portal, TEST_USER_ID, ["Manager"])

for i in range(MAX_LIMIT + 1):
for i in range(self.MAX_LIMIT + 1):
api.content.create(
container=self.portal,
type="Document",
Expand All @@ -44,7 +44,7 @@ def test_search_b_size_default_to_500(self):
"/@search", params={"portal_type": "Document", "b_size": 1000}
)
result = response.json()
self.assertEqual(len(result["items"]), MAX_LIMIT)
self.assertEqual(len(result["items"]), self.MAX_LIMIT)

def test_querystringsearch_post_default_limit_500(self):
response = self.api_session.post(
Expand All @@ -62,8 +62,8 @@ def test_querystringsearch_post_default_limit_500(self):
},
)
result = response.json()
self.assertEqual(len(result["items"]), MAX_LIMIT)
self.assertEqual(result["items_total"], MAX_LIMIT)
self.assertEqual(len(result["items"]), self.MAX_LIMIT)
self.assertEqual(result["items_total"], self.MAX_LIMIT)

def test_querystringsearch_get_default_limit_500(self):
query = {
Expand All @@ -82,5 +82,5 @@ def test_querystringsearch_get_default_limit_500(self):
)

result = response.json()
self.assertEqual(len(result["items"]), MAX_LIMIT)
self.assertEqual(result["items_total"], MAX_LIMIT)
self.assertEqual(len(result["items"]), self.MAX_LIMIT)
self.assertEqual(result["items_total"], self.MAX_LIMIT)

0 comments on commit 988ec19

Please sign in to comment.