Skip to content

Commit

Permalink
Fix testCloneNamedFileBlobsInUpdatedSchema
Browse files Browse the repository at this point in the history
Now plone.dexterity uses the repr function to convert _p_mtime from
float to string. The str function in Python 2 rounded off _p_mtime by
generating schema names with an unexpected format. So we need to use
repr here too, so the test doesn't fail in Python 2.
  • Loading branch information
wesleybl committed Nov 24, 2021
1 parent 7f2a75a commit bb8eb69
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions plone/app/versioningbehavior/tests/test_modifiers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
from five.intid import site
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.app.testing import TEST_USER_ROLES
from plone.app.versioningbehavior.modifiers import CloneNamedFileBlobs
from plone.app.versioningbehavior.modifiers import SkipRelations
from plone.app.versioningbehavior.testing import PLONE_APP_VERSIONINGBEHAVIOR_FUNCTIONAL_TESTING
Expand Down Expand Up @@ -393,7 +391,7 @@ def testCloneNamedFileBlobsInUpdatedSchema(self):
attrs_dict = modifier.getReferencedAttributes(file1)
schema_name = portalTypeToSchemaName(
'BlobFile',
suffix=str(self.portal.portal_types.BlobFile._p_mtime)
suffix=repr(self.portal.portal_types.BlobFile._p_mtime)
)
attr = "plone.dexterity.schema.generated." + schema_name + ".file"
self.assertTrue(attr in attrs_dict)
Expand Down

0 comments on commit bb8eb69

Please sign in to comment.