diff babel/messages/tests/pofile.py @ 591:d1618dfaf114 trunk

change Locale comparison: Locales are now considered equal if all of their attributes (language, territory, script, variant) are equal. Before __eq__ used the simple string representation which hides errors in Locale instantiation (see #279 and #311 for more information).
author fschwarz
date Thu, 09 Aug 2012 07:36:36 +0000
parents 5c9dba5dd311
children
line wrap: on
line diff
--- a/babel/messages/tests/pofile.py
+++ b/babel/messages/tests/pofile.py
@@ -16,6 +16,7 @@
 from StringIO import StringIO
 import unittest
 
+from babel.core import Locale
 from babel.messages.catalog import Catalog, Message
 from babel.messages import pofile
 from babel.util import FixedOffsetTimezone
@@ -27,7 +28,7 @@
         buf = StringIO(r'''msgid "foo"
 msgstr "Voh"''')
         catalog = pofile.read_po(buf, locale='en_US')
-        self.assertEqual('en_US', catalog.locale)
+        self.assertEqual(Locale('en', 'US'), catalog.locale)
 
     def test_preserve_domain(self):
         buf = StringIO(r'''msgid "foo"
Copyright (C) 2012-2017 Edgewall Software