Commit 34fc009d authored by Arnaud Fontaine's avatar Arnaud Fontaine

TypesTool.getInterfaceTypeList(): Filesystem Interfaces were not returned.

And thus filesystem Interfaces were not displayed/selectable in BaseType_view.
parent 23b2b5fd
...@@ -274,9 +274,11 @@ class TypesTool(TypeProvider): ...@@ -274,9 +274,11 @@ class TypesTool(TypeProvider):
Return a list of class names that can be used as Interfaces Return a list of class names that can be used as Interfaces
""" """
from Products.ERP5Type import interfaces from Products.ERP5Type import interfaces
from zope.interface.interface import InterfaceClass
return self._getTypeList( return self._getTypeList(
'Interface Component', 'Interface Component',
[name for name, _ in inspect.getmembers(interfaces, inspect.isclass)]) [name for name, _ in inspect.getmembers(interfaces,
lambda x: isinstance(x, InterfaceClass))])
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'resetDynamicDocumentsOnceAtTransactionBoundary') 'resetDynamicDocumentsOnceAtTransactionBoundary')
......
...@@ -226,9 +226,10 @@ class TestPortalTypeClass(ERP5TypeTestCase): ...@@ -226,9 +226,10 @@ class TestPortalTypeClass(ERP5TypeTestCase):
# a new interface # a new interface
class IForTest(Interface): class IForTest(Interface):
pass pass
self.assertFalse('IForTest' in self.portal.portal_types.getInterfaceTypeList())
from Products.ERP5Type import interfaces from Products.ERP5Type import interfaces
interfaces.IForTest = IForTest interfaces.IForTest = IForTest
self.assertTrue('IForTest' in self.portal.portal_types.getInterfaceTypeList())
# one new type # one new type
dummy_type = types_tool.newContent('InterfaceTestType', dummy_type = types_tool.newContent('InterfaceTestType',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment