Commit 83917e1e authored by Jean-Paul Smets's avatar Jean-Paul Smets

added support for new aq_dynamic


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2085 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent da3d75c3
......@@ -86,13 +86,14 @@ class TestERP5Type(ERP5TypeTestCase):
def test_01_AqDynamic(self):
portal = self.getPortal()
#module = portal.person
from Products.ERP5Type.Base import initializeDynamicProperties, Base
from Products.ERP5Type.Base import initializeClassDynamicProperties
from Products.ERP5Type.Base import initializePortalTypeDynamicProperties
from Products.ERP5Type.Base import Base
from Products.ERP5Type import Document
initializeDynamicProperties(portal, Base)
initializeClassDynamicProperties(portal, Base)
# Base class should now have a state method
#self.failUnless(hasattr(Base, 'getFirstName'))
def test_02_AqDynamic(self):
portal = self.getPortal()
module = portal.person
......@@ -100,10 +101,12 @@ class TestERP5Type(ERP5TypeTestCase):
from Products.ERP5Type import Document
# Person class should have no method getFirstName
self.failUnless(not hasattr(Document.Person, 'getFirstName'))
# Calling getFirstName should produce dynamic methods
# Calling getFirstName should produce dynamic methods related to the portal_type
name = person.getFirstName()
# Person class should have no method getFirstName
self.failUnless(not hasattr(Document.Person, 'getFirstName'))
# Person class should now have method getFirstName
self.failUnless(hasattr(Document.Person, 'getFirstName'))
self.failUnless(hasattr(person, 'getFirstName'))
if __name__ == '__main__':
......
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