[Zope3-checkins] SVN: Zope3/branches/jim-adapter/src/zope/ Get rid of deprecated mutable message ids that are slated for removal in

Philipp von Weitershausen philikon at philikon.de
Tue Apr 4 02:15:29 EDT 2006


Log message for revision 66360:
  Get rid of deprecated mutable message ids that are slated for removal in
  Zope 3.3.
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/app/i18n/__init__.py
  U   Zope3/branches/jim-adapter/src/zope/app/locales/extract.py
  U   Zope3/branches/jim-adapter/src/zope/app/security/_protections.py
  U   Zope3/branches/jim-adapter/src/zope/formlib/form.py
  U   Zope3/branches/jim-adapter/src/zope/i18n/__init__.py
  D   Zope3/branches/jim-adapter/src/zope/i18n/messageid.py
  U   Zope3/branches/jim-adapter/src/zope/i18n/tests/test_translationdomain.py
  U   Zope3/branches/jim-adapter/src/zope/i18n/translationdomain.py
  U   Zope3/branches/jim-adapter/src/zope/i18nmessageid/DEPENDENCIES.cfg
  U   Zope3/branches/jim-adapter/src/zope/i18nmessageid/__init__.py
  D   Zope3/branches/jim-adapter/src/zope/i18nmessageid/messageid.py
  U   Zope3/branches/jim-adapter/src/zope/i18nmessageid/tests.py
  U   Zope3/branches/jim-adapter/src/zope/tal/dummyengine.py
  U   Zope3/branches/jim-adapter/src/zope/tal/talinterpreter.py
  U   Zope3/branches/jim-adapter/src/zope/tal/tests/test_talinterpreter.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/app/i18n/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/i18n/__init__.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/app/i18n/__init__.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -17,19 +17,6 @@
 """
 __docformat__ = 'restructuredtext'
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageIDFactory, MessageFactory
-zope.deprecation.__show__.on()
-
-# import one of these as _ to create i18n messages in the zope domain
-ZopeMessageIDFactory = MessageIDFactory('zope')
+# import this as _ to create i18n messages in the zope domain
+from zope.i18nmessageid import MessageFactory
 ZopeMessageFactory = MessageFactory('zope')
-
-zope.deprecation.deprecated('ZopeMessageIDFactory',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'ZopeMessageFactory instead of '
-                            'ZopeMessageIDFactory.')

Modified: Zope3/branches/jim-adapter/src/zope/app/locales/extract.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/locales/extract.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/app/locales/extract.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -25,15 +25,10 @@
 import traceback
 from pygettext import safe_eval, normalize, make_escapes
 
-from interfaces import IPOTEntry, IPOTMaker, ITokenEater
 from zope.interface import implements
+from zope.i18nmessageid import Message
+from zope.app.locales.interfaces import IPOTEntry, IPOTMaker, ITokenEater
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
 DEFAULT_CHARSET = 'UTF-8'
 DEFAULT_ENCODING = '8bit'
 
@@ -117,10 +112,8 @@
     def write(self, file):
         if self.comments:
             file.write(self.comments)
-        if (isinstance(self.msgid, MessageID) and
-               self.msgid != self.msgid.default) or (
-           isinstance(self.msgid, Message) and
-               self.msgid.default is not None):
+        if (isinstance(self.msgid, Message) and
+            self.msgid.default is not None):
             default = self.msgid.default.strip()
             lines = normalize(default).split("\n")
             lines[0] = "#. Default: %s\n" % lines[0]

Modified: Zope3/branches/jim-adapter/src/zope/app/security/_protections.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/app/security/_protections.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/app/security/_protections.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -17,30 +17,19 @@
 """
 
 def protect():
-    from zope.security.checker import NoProxy
-
-    # BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-    import zope.deprecation
-    zope.deprecation.__show__.off()
-    from zope.i18nmessageid import MessageID, Message
-    zope.deprecation.__show__.on()
-
     # Add message id types to the basic types, so their setting cannot be
     # overridden, once set. `protect()` was not guranteed to run after
     # zope.security.checker._clear, so that sometimes the proxies were not set.
     # This is not the ideal solution, but it is effective.
 
-    # Make sure the message id gets never proxied
-    # TODO because MessageIDs are mutable, this is a security hole.  This hole
-    # is one of the primary reasons for the development of the Message
-    # replacement.  See zope/i18nmessageid/messages.txt.
-    zope.security.checker.BasicTypes[MessageID] = NoProxy
-    # this, however, is not a security hole, because Messages are immutable.
+    # Make sure the message id gets never proxied.  This is not a
+    # security hole because Messages are immutable.
+    import zope.security.checker
+    from zope.security.checker import NoProxy
+    from zope.i18nmessageid import Message
     zope.security.checker.BasicTypes[Message] = NoProxy
 
     # add __parent__ and __name__ to always available names
-    import zope.security.checker
     for name in ['__name__', '__parent__']:
         if name not in zope.security.checker._available_by_default:
             zope.security.checker._available_by_default.append(name)
-

Modified: Zope3/branches/jim-adapter/src/zope/formlib/form.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/formlib/form.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/formlib/form.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -14,7 +14,6 @@
 
 $Id$
 """
-
 import datetime
 import re
 import sys
@@ -22,6 +21,7 @@
 
 import zope.event
 import zope.i18n
+import zope.i18nmessageid
 import zope.publisher.interfaces.browser
 
 from zope import component, interface, schema
@@ -585,7 +585,7 @@
     if not self.available():
         return ''
     label = self.label
-    if isinstance(label, (zope.i18n.Message, zope.i18n.MessageID)):
+    if isinstance(label, zope.i18nmessageid.Message):
         label = zope.i18n.translate(self.label, context=self.form.request)
     return ('<input type="submit" id="%s" name="%s" value="%s"'
             ' class="button" />' %

Modified: Zope3/branches/jim-adapter/src/zope/i18n/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/__init__.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/i18n/__init__.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -18,12 +18,6 @@
 import re
 import warnings
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageIDFactory, MessageID
-zope.deprecation.__show__.on()
-
 from zope.i18nmessageid import MessageFactory, Message
 from zope.i18n.interfaces import ITranslationDomain
 from zope.i18n.interfaces import IFallbackTranslationDomainFactory
@@ -41,7 +35,7 @@
 def _translate(msgid, domain=None, mapping=None, context=None,
                target_language=None, default=None):
 
-    if isinstance(msgid, (MessageID, Message)):
+    if isinstance(msgid, Message):
         domain = msgid.domain
         default = msgid.default
         mapping = msgid.mapping

Deleted: Zope3/branches/jim-adapter/src/zope/i18n/messageid.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/messageid.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/i18n/messageid.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -1,36 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (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.
-#
-##############################################################################
-"""Provide a backwards compatible import location for i18n message
-ids.  This module will be removed from Zope 3.3.
-
-$Id$
-"""
-##############################################################################
-# BBB 2005/10/10 -- remove the whole module for Zope 3.3
-#
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, MessageIDFactory
-from zope.i18nmessageid import Message, MessageFactory
-zope.deprecation.__show__.on()
-
-zope.deprecation.deprecated(
-    ('MessageID', 'MessageIDFactory' 'Message', 'MessageFactory'),
-    "The zope.i18n.messageid module as a backwards-compatible import "
-    "location for i18n message ids has been deprecated and will be "
-    "removed from Zope 3.3.  Please use Message and MessageFactory "
-    "from the zope.i18nmessageid package instead."
-    )
-#
-##############################################################################

Modified: Zope3/branches/jim-adapter/src/zope/i18n/tests/test_translationdomain.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/tests/test_translationdomain.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/i18n/tests/test_translationdomain.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -20,7 +20,7 @@
 from zope.i18n.gettextmessagecatalog import GettextMessageCatalog
 from zope.i18n.tests.test_itranslationdomain import \
      TestITranslationDomain, Environment
-from zope.i18n import MessageIDFactory
+from zope.i18nmessageid import MessageFactory
 from zope.i18n.interfaces import ITranslationDomain
 import zope.component
 
@@ -80,7 +80,7 @@
             u'Hello!')
 
     def testMessageIDTranslate(self):
-        factory = MessageIDFactory('default')
+        factory = MessageFactory('default')
         translate = self._domain.translate
         msgid = factory(u'short_greeting', 'default')
         self.assertEqual(translate(msgid, target_language='en'), u'Hello!')
@@ -100,7 +100,7 @@
 
         zope.component.provideUtility(domain, ITranslationDomain, 'other')
 
-        factory = MessageIDFactory('other')
+        factory = MessageFactory('other')
         msgid = factory(u'short_greeting', 'default')
         self.assertEqual(
             self._domain.translate(msgid, target_language='en'), u'Hello!')

Modified: Zope3/branches/jim-adapter/src/zope/i18n/translationdomain.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18n/translationdomain.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/i18n/translationdomain.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -15,17 +15,11 @@
 
 $Id$
 """
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
+from zope.component import getUtility
+from zope.i18nmessageid import Message
 from zope.i18n import interpolate
 from zope.i18n.simpletranslationdomain import SimpleTranslationDomain
-from zope.component import getUtility
-from zope.i18n.interfaces import ITranslationDomain
-from zope.i18n.interfaces import INegotiator
+from zope.i18n.interfaces import ITranslationDomain, INegotiator
 
 # The configuration should specify a list of fallback languages for the
 # site.  If a particular catalog for a negotiated language is not available,
@@ -84,7 +78,7 @@
             target_language = negotiator.getLanguage(langs, context)
 
         # MessageID attributes override arguments
-        if isinstance(msgid, (Message, MessageID)):
+        if isinstance(msgid, Message):
             if msgid.domain != self.domain:
                 util = getUtility(ITranslationDomain, msgid.domain)
             mapping = msgid.mapping

Modified: Zope3/branches/jim-adapter/src/zope/i18nmessageid/DEPENDENCIES.cfg
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18nmessageid/DEPENDENCIES.cfg	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/i18nmessageid/DEPENDENCIES.cfg	2006-04-04 06:15:28 UTC (rev 66360)
@@ -1,2 +1 @@
 zope.testing
-zope.deprecation

Modified: Zope3/branches/jim-adapter/src/zope/i18nmessageid/__init__.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18nmessageid/__init__.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/i18nmessageid/__init__.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -15,24 +15,4 @@
 
 $Id$
 """
-##############################################################################
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-#
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid.messageid import MessageID, MessageIDFactory
-zope.deprecation.__show__.on()
-zope.deprecation.deprecated('MessageID',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'zope.i18nmessageid.Message instead.')
-zope.deprecation.deprecated('MessageIDFactory',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'use zope.i18nmessageid.MessageFactory instead.')
-#
-##############################################################################
-
 from zope.i18nmessageid.message import Message, MessageFactory

Deleted: Zope3/branches/jim-adapter/src/zope/i18nmessageid/messageid.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18nmessageid/messageid.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/i18nmessageid/messageid.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -1,114 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2003 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (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.
-#
-##############################################################################
-"""Message IDs.
-
-$Id$
-"""
-import zope.deprecation
-zope.deprecation.deprecated('MessageID',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'zope.i18nmessageid.Message instead.')
-zope.deprecation.deprecated('MessageIDFactory',
-                            'Mutable i18n messages ("message ids") have been '
-                            'deprecated in favour of immutable ones and will '
-                            'be removed in Zope 3.3.  Please use '
-                            'use zope.i18nmessageid.MessageFactory instead.')
-
-class MessageID(unicode):
-    """Message ID.
-
-    This is a string used as a message ID.  It has a domain attribute that is
-    its source domain, and a default attribute that is its default text to
-    display when there is no translation.  domain may be None meaning there is
-    no translation domain.  default may also be None, in which case the
-    message id itself implicitly serves as the default text.
-
-    MessageID objects also have a mapping attribute which must be set after
-    construction of the object.  This is used when translating and
-    substituting variables.
-
-    To instanciate MessageIDs, it is recommended to use MessageIDFactory:
-
-    >>> fact = MessageIDFactory('test')
-
-    Now we can use the factory to make MessageIDs. Note that MessageID
-    is a subclass of unicode:
-
-    >>> id = fact(u'this is a test')
-    >>> isinstance(id, MessageID)
-    True
-    >>> isinstance(id, unicode)
-    True
-
-    Additional parameters, such as the i18n domain and the default
-    text are available through attributes:
-
-    >>> id.domain
-    'test'
-    >>> id.default
-    u'this is a test'
-
-    You can also reset the default text:
-
-    >>> id.default = u'blah'
-    >>> id.default
-    u'blah'
-
-    It is quite common to pass an abstract identifier as message id
-    and then a default text:
-
-    >>> id = fact(u'test-id', 'default test')
-    >>> id
-    u'test-id'
-    >>> id.default
-    u'default test'
-    >>> id.domain
-    'test'
-    """
-
-    __slots__ = ('domain', 'default', 'mapping')
-
-    def __new__(cls, ustr, domain=None, default=None):
-        self = unicode.__new__(cls, ustr)
-        self.domain = domain
-        if default is None:
-            self.default = ustr
-        else:
-            self.default = unicode(default)
-        self.mapping = {}
-        return self
-
-    def __getstate__(self):
-        return unicode(self), self.domain, self.default, self.mapping
-
-    def __setstate__(self, (ustr, domain, default, mapping)):
-        super(MessageID, self).__init__(ustr)
-        self.domain = domain
-        if default is None:
-            self.default = ustr
-        else:
-            self.default = default
-        self.mapping = mapping
-
-
-class MessageIDFactory(object):
-    """Factory for creating MessageIDs."""
-
-    def __init__(self, domain):
-        self._domain = domain
-
-    def __call__(self, ustr, default=None):
-        return MessageID(ustr, self._domain, default)

Modified: Zope3/branches/jim-adapter/src/zope/i18nmessageid/tests.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/i18nmessageid/tests.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/i18nmessageid/tests.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -20,7 +20,6 @@
 
 def test_suite():
     return unittest.TestSuite((
-	    DocTestSuite('zope.i18nmessageid.messageid'),
 	    DocTestSuite('zope.i18nmessageid.message'),
 	    DocFileSuite('messages.txt', package='zope.i18nmessageid'),
 	    ))

Modified: Zope3/branches/jim-adapter/src/zope/tal/dummyengine.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/tal/dummyengine.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/tal/dummyengine.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -20,14 +20,9 @@
 from zope.interface import implements
 from zope.tal.taldefs import NAME_RE, TALExpressionError, ErrorInfo
 from zope.tal.interfaces import ITALExpressionCompiler, ITALExpressionEngine
+from zope.i18nmessageid import Message
 from zope.i18n.interfaces import ITranslationDomain
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
 Default = object()
 
 name_match = re.compile(r"(?s)(%s):(.*)\Z" % NAME_RE).match
@@ -142,7 +137,7 @@
 
     def evaluateText(self, expr):
         text = self.evaluate(expr)
-        if isinstance(text, (str, unicode, MessageID, Message)):
+        if isinstance(text, (str, unicode, Message)):
             return text
         if text is not None and text is not Default:
             text = str(text)
@@ -298,7 +293,7 @@
         # by calling that method.
 
         # MessageID attributes override arguments
-        if isinstance(msgid, (MessageID, Message)):
+        if isinstance(msgid, Message):
             domain = msgid.domain
             mapping = msgid.mapping
             default = msgid.default
@@ -325,7 +320,7 @@
     
     def translate(self, msgid, domain=None, mapping=None, default=None):
         
-        if isinstance(msgid, (MessageID, Message)):
+        if isinstance(msgid, Message):
             domain = msgid.domain
         
         if domain == 'a_very_explicit_domain_setup_by_template_developer_that_wont_be_taken_into_account_by_the_ZPT_engine':

Modified: Zope3/branches/jim-adapter/src/zope/tal/talinterpreter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/tal/talinterpreter.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/tal/talinterpreter.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -23,12 +23,7 @@
 # Do not use cStringIO here!  It's not unicode aware. :(
 from StringIO import StringIO
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
+from zope.i18nmessageid import Message
 from zope.tal.taldefs import quote, TAL_VERSION, METALError
 from zope.tal.taldefs import isCurrentVersion
 from zope.tal.taldefs import getProgramVersion, getProgramMode
@@ -37,7 +32,7 @@
 
 
 # Avoid constructing this tuple over and over
-I18nMessageTypes = (MessageID, Message)
+I18nMessageTypes = (Message,)
 
 TypesToTranslate = I18nMessageTypes + (str, unicode)
 

Modified: Zope3/branches/jim-adapter/src/zope/tal/tests/test_talinterpreter.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/tal/tests/test_talinterpreter.py	2006-04-04 06:14:04 UTC (rev 66359)
+++ Zope3/branches/jim-adapter/src/zope/tal/tests/test_talinterpreter.py	2006-04-04 06:15:28 UTC (rev 66360)
@@ -30,13 +30,8 @@
 from zope.tal.dummyengine import MultipleDomainsDummyEngine
 from zope.tal.dummyengine import DummyTranslationDomain
 from zope.tal.tests import utils
+from zope.i18nmessageid import Message
 
-# BBB 2005/10/10 -- MessageIDs are to be removed for Zope 3.3
-import zope.deprecation
-zope.deprecation.__show__.off()
-from zope.i18nmessageid import MessageID, Message
-zope.deprecation.__show__.on()
-
 class TestCaseBase(unittest.TestCase):
 
     def _compile(self, source):
@@ -455,22 +450,13 @@
             "Foo <span tal:replace='bar' i18n:name='bar' /></div>")
         self._check(program, u"<div>FOO \u00C0</div>\n")
 
-    
-class I18NCornerTestCaseMessageID(I18NCornerTestCaseBase):
+class I18NCornerTestCaseMessage(I18NCornerTestCaseBase):
 
     def factory(self, msgid, default=None, mapping={}, domain=None):
-        m = MessageID(msgid, default=default)
-        m.mapping = mapping
-        return m
+        return Message(msgid, domain=domain, default=default, mapping=mapping)
 
-class UnusedExplicitDomainTestCase(I18NCornerTestCaseMessageID):
+class UnusedExplicitDomainTestCase(I18NCornerTestCaseMessage):
     
-    def factory(self, msgid, default=None, mapping={}, domain=None):
-        m = MessageID(msgid, default=default, domain=domain)
-        m.mapping = mapping
-        return m
-
-    
     def setUp(self):
         # MultipleDomainsDummyEngine is a Engine
         # where default domain transforms to uppercase
@@ -538,11 +524,6 @@
             '     tal:content="baz" />')
         self._check(program, '<div>BAZVALUE</div>\n')
 
-class I18NCornerTestCaseMessage(I18NCornerTestCaseBase):
-
-    def factory(self, msgid, default=None, mapping={}):
-        return Message(msgid, default=default, mapping=mapping)
-
 class ScriptTestCase(TestCaseBase):
 
     def setUp(self):
@@ -762,7 +743,6 @@
     suite.addTest(unittest.makeSuite(MacroExtendTestCase))
     suite.addTest(unittest.makeSuite(OutputPresentationTestCase))
     suite.addTest(unittest.makeSuite(ScriptTestCase))
-    suite.addTest(unittest.makeSuite(I18NCornerTestCaseMessageID))
     suite.addTest(unittest.makeSuite(I18NCornerTestCaseMessage))
     suite.addTest(unittest.makeSuite(UnusedExplicitDomainTestCase))
     suite.addTest(unittest.makeSuite(TestSourceAnnotations))



More information about the Zope3-Checkins mailing list