Commit b84bb302 authored by Nicolas Dumazet's avatar Nicolas Dumazet

ERP5Type.Document.Person is a module and will never hold the method.

The class is located in Document.Person.Person


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38480 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent df875d9f
...@@ -193,14 +193,14 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -193,14 +193,14 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
def test_02_AqDynamic(self): def test_02_AqDynamic(self):
module = self.getPersonModule() module = self.getPersonModule()
person = module.newContent(id='1', portal_type='Person') person = module.newContent(id='1', portal_type='Person')
from Products.ERP5Type import Document from Products.ERP5Type.Document import Person
# Person class should have no method getFirstName # Person class should have no method getFirstName
self.assertFalse(hasattr(Document.Person, 'getFirstName')) self.assertFalse(hasattr(Person.Person, 'getFirstName'))
# Calling getFirstName should produce dynamic methods related to the # Calling getFirstName should produce dynamic methods related to the
# portal_type # portal_type
name = person.getFirstName() name = person.getFirstName()
# Person class should have no method getFirstName # Person class should have no method getFirstName
self.assertFalse(hasattr(Document.Person, 'getFirstName')) self.assertFalse(hasattr(Person.Person, 'getFirstName'))
# Person class should now have method getFirstName # Person class should now have method getFirstName
self.assertTrue(hasattr(person, 'getFirstName')) self.assertTrue(hasattr(person, 'getFirstName'))
......
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