Commit 9191a342 authored by Florent Guillaume's avatar Florent Guillaume

Collector #1803: Fixed InitializeClass for some corner case

parent 7d57a8b1
...@@ -26,6 +26,8 @@ Zope Changes ...@@ -26,6 +26,8 @@ Zope Changes
Bugs Fixed Bugs Fixed
- Collector #1803: Fixed InitializeClass for some corner case.
- Collector #1798, issue 1: ZopeTestCase no longer tries to - Collector #1798, issue 1: ZopeTestCase no longer tries to
install products that was installed by Zope during startup. install products that was installed by Zope during startup.
......
...@@ -43,8 +43,8 @@ def default__class_init__(self): ...@@ -43,8 +43,8 @@ def default__class_init__(self):
else: else:
# Supply a name implicitly so that the method can # Supply a name implicitly so that the method can
# find the security assertions on its container. # find the security assertions on its container.
d['_implicit__name__'] = 1 v._implicit__name__ = 1
d['__name__']=name v.__name__ = name
if name=='manage' or name[:7]=='manage_': if name=='manage' or name[:7]=='manage_':
name=name+'__roles__' name=name+'__roles__'
if not have(name): if not have(name):
......
##############################################################################
#
# Copyright (c) 2005 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Tests class initialization.
"""
import ExtensionClass
from App.class_init import default__class_init__ as InitializeClass
def test_InitializeClass():
"""Test that InitializeClass (default__class_init__)
works in specific corner cases.
Check when the class has an ExtensionClass as attribute.
>>> class AnotherClass(ExtensionClass.Base):
... _need__name__ = 1
>>> class C:
... foo = AnotherClass
>>> InitializeClass(C)
"""
from zope.testing.doctest import DocTestSuite
import unittest
def test_suite():
return unittest.TestSuite((
DocTestSuite(),
))
if __name__ == '__main__':
unittest.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