Skip to content

Commit

Permalink
Include test to trigger the bug. refs gh-3916
Browse files Browse the repository at this point in the history
  • Loading branch information
frapell committed Mar 5, 2024
1 parent 2355693 commit 6813a99
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Products/CMFPlone/tests/testCatalogTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from plone.indexer.wrapper import IndexableObjectWrapper
from plone.uuid.interfaces import IAttributeUUID
from plone.uuid.interfaces import IUUID
from plone.namedfile.file import NamedImage
from Products.CMFCore.indexing import processQueue
from Products.CMFCore.permissions import AccessInactivePortalContent
from Products.CMFPlone.CatalogTool import CatalogTool
Expand Down Expand Up @@ -1414,6 +1415,21 @@ def test_uuid(self):
self.assertTrue(wrapped.UID)
self.assertTrue(uuid == wrapped.UID)

def test_getIcon(self):
from Products.CMFPlone.CatalogTool import getIcon

get_icon = getIcon.callable
self.assertFalse(get_icon(self.folder))
# Create an item inside the test folder
self.folder.invokeFactory("Image", "image", title="Image")
# Do not get the "image" content item
self.assertFalse(get_icon(self.folder))
# Return False if item doesn't have an image
self.assertFalse(get_icon(self.folder.image))
self.folder.image.image=NamedImage(dummy.Image())
# Item has a proper image, return True
self.assertTrue(get_icon(self.folder.image))


class TestObjectProvidedIndexExtender(unittest.TestCase):
def _index(self, object):
Expand Down

0 comments on commit 6813a99

Please sign in to comment.