[Zope3-checkins] CVS: Zope3/src/zope/i18n/tests - test_negotiator.py:1.6.16.1

Sidnei da Silva sidnei at x3ng.com.br
Fri Feb 27 12:36:39 EST 2004


Update of /cvs-repository/Zope3/src/zope/i18n/tests
In directory cvs.zope.org:/tmp/cvs-serv31559/tests

Modified Files:
      Tag: runyaga-sip-branch
	test_negotiator.py 
Log Message:
Improve negotiator to cope with the fact that the list of language names coming from the translation service may not match the same formatting of the languages coming from the user preferences, so we normalize them before comparing.


=== Zope3/src/zope/i18n/tests/test_negotiator.py 1.6 => 1.6.16.1 ===
--- Zope3/src/zope/i18n/tests/test_negotiator.py:1.6	Sat Jan 10 06:02:37 2004
+++ Zope3/src/zope/i18n/tests/test_negotiator.py	Fri Feb 27 12:36:38 2004
@@ -32,17 +32,19 @@
         return self.langs
 
 
-class Test(PlacelessSetup, unittest.TestCase):
+class NegotiatorTest(PlacelessSetup, unittest.TestCase):
 
     def setUp(self):
-        super(Test, self).setUp()
+        super(NegotiatorTest, self).setUp()
         self.Negotiator = Negotiator()
 
     def test1(self):
 
         _cases = (
             (('en','de'), ('en','de','fr'),  'en'),
-            (('en'),      ('it','de','fr'),  None)
+            (('en'),      ('it','de','fr'),  None),
+            (('pt-br','de'), ('pt_BR','de','fr'),  'pt_BR'),
+            (('pt-br','en'), ('pt','en','fr'),  'en'),
             )
 
         for user_pref_langs, obj_langs, expected in _cases:
@@ -53,7 +55,7 @@
 
 def test_suite():
     loader = unittest.TestLoader()
-    return loader.loadTestsFromTestCase(Test)
+    return loader.loadTestsFromTestCase(NegotiatorTest)
 
 
 if __name__ == '__main__':




More information about the Zope3-Checkins mailing list