From 253c67340354a32d9925e492562dc5630c995c17 Mon Sep 17 00:00:00 2001 From: ale-rt Date: Tue, 26 Oct 2021 17:26:12 +0200 Subject: [PATCH] Adapt the tests for Plone 6 Adapt the tests to cope with the fact the since Plone 6 the Plone site root is cataloged --- news/236.bugfix | 1 + plone/app/content/tests/test_folder.py | 2 +- plone/app/content/tests/test_widgets.py | 24 ++++++++++++++++++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 news/236.bugfix diff --git a/news/236.bugfix b/news/236.bugfix new file mode 100644 index 00000000..0bd847e7 --- /dev/null +++ b/news/236.bugfix @@ -0,0 +1 @@ +Adapt the tests to cope with the fact the since Plone 6 the Plone site root is cataloged [ale-rt] diff --git a/plone/app/content/tests/test_folder.py b/plone/app/content/tests/test_folder.py index eb37148c..3751d8a6 100644 --- a/plone/app/content/tests/test_folder.py +++ b/plone/app/content/tests/test_folder.py @@ -162,7 +162,7 @@ def testStateChange(self): effective_index = self.convertDateTimeToIndexRepr( self.portal.page.effective_date ) - self.assertEqual(pc.uniqueValuesFor("effective"), (effective_index,)) + self.assertIn(effective_index, pc.uniqueValuesFor("effective")) class RenameTest(BaseTest): diff --git a/plone/app/content/tests/test_widgets.py b/plone/app/content/tests/test_widgets.py index 8eeaa665..15b36b2c 100644 --- a/plone/app/content/tests/test_widgets.py +++ b/plone/app/content/tests/test_widgets.py @@ -122,7 +122,12 @@ def testVocabularyCatalogResults(self): "i": "path", "o": "plone.app.querystring.operation.string.path", "v": "/plone", - } + }, + { + "i": "portal_type", + "o": "plone.app.querystring.operation.selection.any", + "v": "Document", + }, ] } self.request.form.update( @@ -216,7 +221,12 @@ def testVocabularyBatching(self): "i": "path", "o": "plone.app.querystring.operation.string.path", "v": "/plone", - } + }, + { + "i": "portal_type", + "o": "plone.app.querystring.operation.selection.any", + "v": "Document", + }, ] } # batch pages are 1-based @@ -601,10 +611,20 @@ def testUntranslatableMetadata(self): def testGetMimeIcon(self): """Check if the returned icon is correct""" + query = { + "criteria": [ + { + "i": "portal_type", + "o": "plone.app.querystring.operation.selection.any", + "v": "File", + }, + ] + } self.request.form.update( { "name": "plone.app.vocabularies.Catalog", "attributes": ["getMimeIcon"], + "query": json.dumps(query), } ) view = VocabularyView(self.portal, self.request)