[Zope3-checkins] CVS: Zope3/src/zope/publisher/tests -
test_http.py:1.22
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Feb 5 17:53:07 EST 2004
Update of /cvs-repository/Zope3/src/zope/publisher/tests
In directory cvs.zope.org:/tmp/cvs-serv7674/src/zope/publisher/tests
Modified Files:
test_http.py
Log Message:
ICU joined openi18n.org and developed a locale data XML standard called
LDML. A result of this was that all locale files were changed to this new
format. To stay up-to-date with the latest data, I converted the locale
parser to read the new format. While I was at it, I also changed the Locale
data structure a bit, since I wanted to keep the objects similar to the
XML. Furthermore, the first time around I did not implement the inheritance
of object attributes and dictionaries correctly (I just faked it for the
API calls), so I think I got it right this time. Finally I updated views
and tests that relied on the old Locale API. Be aware that you might need
to change some of your product code as well.
=== Zope3/src/zope/publisher/tests/test_http.py 1.21 => 1.22 ===
--- Zope3/src/zope/publisher/tests/test_http.py:1.21 Fri Nov 21 12:12:29 2003
+++ Zope3/src/zope/publisher/tests/test_http.py Thu Feb 5 17:52:36 2004
@@ -27,7 +27,7 @@
from zope.publisher.base import DefaultPublication
from zope.publisher.interfaces.http import IHTTPRequest
-from zope.i18n.interfaces import ILocale
+from zope.i18n.interfaces.locales import ILocale
from zope.interface.verify import verifyObject
@@ -148,20 +148,20 @@
unless(ILocale.isImplementedBy(locale))
parts = httplang.split('-')
lang = parts.pop(0).lower()
- country = variant = None
+ territory = variant = None
if parts:
- country = parts.pop(0).upper()
+ territory = parts.pop(0).upper()
if parts:
variant = parts.pop(0).upper()
eq(locale.id.language, lang)
- eq(locale.id.country, country)
+ eq(locale.id.territory, territory)
eq(locale.id.variant, variant)
# Now test for non-existant locale fallback
req = self._createRequest({'HTTP_ACCEPT_LANGUAGE': 'xx'})
locale = req.locale
unless(ILocale.isImplementedBy(locale))
eq(locale.id.language, None)
- eq(locale.id.country, None)
+ eq(locale.id.territory, None)
eq(locale.id.variant, None)
# If the first language is not available we should try others
@@ -169,16 +169,16 @@
locale = req.locale
unless(ILocale.isImplementedBy(locale))
eq(locale.id.language, 'en')
- eq(locale.id.country, None)
+ eq(locale.id.territory, None)
eq(locale.id.variant, None)
- # Regression test: there was a bug where country and variant were
+ # Regression test: there was a bug where territory and variant were
# not reset
req = self._createRequest({'HTTP_ACCEPT_LANGUAGE': 'xx-YY,en;q=0.5'})
locale = req.locale
unless(ILocale.isImplementedBy(locale))
eq(locale.id.language, 'en')
- eq(locale.id.country, None)
+ eq(locale.id.territory, None)
eq(locale.id.variant, None)
def testCookies(self):
More information about the Zope3-Checkins
mailing list