Commit 95fcf0a4 authored by Jérome Perrin's avatar Jérome Perrin

add a test to make sure accessor generation doesn't produce any warnings in the

log file.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8646 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 11c91236
......@@ -13,9 +13,10 @@ os.environ['EVENT_LOG_SEVERITY'] = '-300'
from random import randint
from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from zLOG import LOG
from zLOG import LOG, INFO
from Products.CMFCore.tests.base.testcase import LogInterceptor
class TestERP5Type(ERP5TypeTestCase):
class TestERP5Type(ERP5TypeTestCase, LogInterceptor):
# Some helper methods
......@@ -74,11 +75,7 @@ class TestERP5Type(ERP5TypeTestCase):
# Create a business template and test if portal_type matches
# Make a extension tests on basic accessors
portal_templates = self.getTemplateTool()
business_template = self.getTemplateTool().newContent(portal_type="Business Template") # Fails Why ?
# may be because there is
# no "Business Template"
# in portal_types, it may
# be added to erp5_common
business_template = self.getTemplateTool().newContent(portal_type="Business Template")
self.failUnless(business_template.getPortalType() == 'Business Template')
# Test simple string accessor
test_string = self.getRandomString()
......@@ -285,6 +282,17 @@ class TestERP5Type(ERP5TypeTestCase):
new_orga = folder[new_id]
self.assertEquals(new_orga.getTitle(), 'something')
def test_AccessorGeneration(self):
"""Tests accessor generation doesn't generate error messages.
"""
from Products.ERP5Type.Base import _aq_reset
_aq_reset()
self._catch_log_errors(ignored_level=INFO)
folder = self.getOrganisationModule()
orga = folder.newContent(portal_type='Organisation',)
# call an accessor, _aq_dynamic will generate accessors
orga.getId()
self._ignore_log_errors()
if __name__ == '__main__':
framework()
......
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