Skip to content

Commit

Permalink
Use json.dumps for filters parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gbastien committed Mar 16, 2021
1 parent b79d6d4 commit 20a6b08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/collective/iconifiedcategory/tests/test_views.py
Expand Up @@ -74,7 +74,7 @@ def setUp(self):
self.viewinfos = self.portal.restrictedTraverse('@@categorized-childs-infos')
category_uid = self.config['group-1']['category-1-1'].UID()
# filter format is json
filters = "{}"
filters = json.dumps({})
self.viewinfos(category_uid, filters)

def test__call__(self):
Expand Down Expand Up @@ -142,10 +142,11 @@ def test_filters(self):
self.assertEqual(self.viewinfos.categorized_elements[0]['id'], 'file_txt')
# filters are passed to viewinfos as json
self.viewinfos(category_uid=self.viewinfos.category_uid,
filters=json.loads('{"id": "image"}'))
filters=json.dumps({"id": "image"}))
self.assertEqual(len(self.viewinfos.categorized_elements), 1)
self.assertEqual(self.viewinfos.categorized_elements[0]['id'], 'image')


class TestCanViewAwareDownload(BaseTestCase):

def test_default(self):
Expand Down

0 comments on commit 20a6b08

Please sign in to comment.