def get_icon_for_hit(hit): if hit["object_type"] == Folder.entity_type: return icon_url("folder.png") content_type = hit["content_type"] icon = icon_for(content_type) return icon
def icon(self): return icon_for(self.content_type)
def test_icon_from_mime_type(app_context): icon = icon_for("text/html") filename = icon.split("/")[-1] assert filename in ("html.png", "htm.png"), icon