Skip to content

Commit

Permalink
fix Deprecation-Warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Feb 5, 2020
1 parent 81c4866 commit fcb0253
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ develop = .

[versions]
plone.dexterity =
zope.interface = 4.7.1
15 changes: 8 additions & 7 deletions plone/dexterity/tests/test_fti.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from .case import MockTestCase
from mock import Mock
from plone.dexterity import utils
from plone.dexterity.schema import portalTypeToSchemaName
from plone.dexterity.factory import DexterityFactory
from plone.dexterity.fti import DexterityFTI
from plone.dexterity.fti import DexterityFTIModificationDescription
Expand Down Expand Up @@ -73,7 +74,7 @@ def test_lookupSchema_with_dynamic_schema(self):
portal = self.create_dummy(getPhysicalPath=lambda: ('', 'site'))
self.mock_utility(portal, ISiteRoot)

schemaName = utils.portalTypeToSchemaName(fti.getId())
schemaName = portalTypeToSchemaName(fti.getId())
setattr(plone.dexterity.schema.generated, schemaName, ITestSchema)

self.assertEqual(ITestSchema, fti.lookupSchema())
Expand All @@ -89,7 +90,7 @@ def test_lookupSchema_with_nonexistant_schema(self):
fti.schema = 'model.wont.be.imported'
portal = self.create_dummy(getPhysicalPath=lambda: ('', 'site'))
self.mock_utility(portal, ISiteRoot)
schemaName = utils.portalTypeToSchemaName(fti.getId())
schemaName = portalTypeToSchemaName(fti.getId())
setattr(plone.dexterity.schema.generated, schemaName, ITestSchema)
self.assertEqual(ITestSchema, fti.lookupSchema())
delattr(plone.dexterity.schema.generated, schemaName)
Expand Down Expand Up @@ -458,7 +459,7 @@ def test_components_registered_on_add(self):
None,
queryUtility(IDexterityFTI, name=portal_type)
)
self.assertNotEquals(None, queryUtility(IFactory, name=portal_type))
self.assertNotEqual(None, queryUtility(IFactory, name=portal_type))

def test_components_not_registered_on_add_if_exist(self):
portal_type = u"testtype"
Expand Down Expand Up @@ -653,7 +654,7 @@ class IBlank(Interface):
pass

# Set source interface
schemaName = utils.portalTypeToSchemaName(fti.getId())
schemaName = portalTypeToSchemaName(fti.getId())
setattr(plone.dexterity.schema.generated, schemaName, IBlank)

# Sync this with schema
Expand Down Expand Up @@ -689,7 +690,7 @@ class IBlank(Interface):
pass

# Set source interface
schemaName = utils.portalTypeToSchemaName(fti.getId())
schemaName = portalTypeToSchemaName(fti.getId())
setattr(plone.dexterity.schema.generated, schemaName, IBlank)

# Sync this with schema
Expand Down Expand Up @@ -732,7 +733,7 @@ def bases(self, schemaName, tree):
self.mock_utility(site_dummy, ISiteRoot)

# Set source interface
schemaName = utils.portalTypeToSchemaName(fti.getId())
schemaName = portalTypeToSchemaName(fti.getId())
setattr(plone.dexterity.schema.generated, schemaName, IBlank)
original = getattr(plone.dexterity.schema.generated, schemaName)
self.assertNotIn(INew, original.__bases__)
Expand Down Expand Up @@ -776,7 +777,7 @@ class INew(Interface):
assert not fti.hasDynamicSchema

# Set source for dynamic FTI - should not be used
schemaName = utils.portalTypeToSchemaName(fti.getId())
schemaName = portalTypeToSchemaName(fti.getId())
setattr(plone.dexterity.schema.generated, schemaName, IBlank)

# Sync should not happen now
Expand Down

0 comments on commit fcb0253

Please sign in to comment.