File tree Expand file tree Collapse file tree
src/design/plone/contenttypes/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212import unittest
1313
1414
15- class TestUpgradeTo7321 (unittest .TestCase ):
15+ class TestModuloMimeType (unittest .TestCase ):
1616 layer = DESIGN_PLONE_CONTENTTYPES_INTEGRATION_TESTING
1717
1818 def setUp (self ):
@@ -39,6 +39,16 @@ def setUp(self):
3939 contentType = "application/pdf" ,
4040 ),
4141 )
42+ self .modulo_2 = api .content .create (
43+ container = self .documento ,
44+ type = "Modulo" ,
45+ title = "Modulo_2" ,
46+ file_principale = NamedBlobFile (
47+ data = pdf_data ,
48+ filename = "example.pdf" ,
49+ contentType = "application/pdf" ,
50+ ),
51+ )
4252 self .enhancedlinks_tool = api .portal .get_tool ("portal_enhancedlinks" )
4353 # Simulate the stale cache entry that the upgrade has to refresh.
4454 self .enhancedlinks_tool ._enhanced_links [self .modulo .UID ()] = {
@@ -61,3 +71,12 @@ def test_to_7321_refreshes_modulo_mime_type_cache(self):
6171 self .enhancedlinks_tool .get_enhanced_link (self .modulo .UID ())["mime_type" ],
6272 "application/pdf" ,
6373 )
74+
75+ def test_modulo_mime_type_indexer (self ):
76+ # The indexer should return the correct mime type for the Modulo.
77+
78+ catalog = api .portal .get_tool ("portal_catalog" )
79+ results = catalog (UID = self .modulo_2 .UID ())
80+ brain = results [0 ]
81+
82+ self .assertEqual (brain .mime_type , "application/pdf" )
You can’t perform that action at this time.
0 commit comments