[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Publisher/Browser/tests - testDirectives.py:1.11

Marius Gedminas mgedmin@delfi.lt
Tue, 25 Jun 2002 10:44:52 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/Publisher/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv22296/lib/python/Zope/App/Publisher/Browser/tests

Modified Files:
	testDirectives.py 
Log Message:
Check that i18n-resource directive specifies a translation for the
default language, and that it does not contain translations of different
types (no mixing of text and images).


=== Zope3/lib/python/Zope/App/Publisher/Browser/tests/testDirectives.py 1.10 => 1.11 ===
         self.assertEqual(v._testData('fr'), open(path2, 'rb').read())
 
+        # translation must be provided for the default language
+        config = StringIO(template % (
+            """
+            <browser:i18n-resource name="test" defaultLanguage="fr">
+              <browser:translation language="en" file="%s" />
+              <browser:translation language="lt" file="%s" />
+            </browser:i18n-resource>
+            """ % (path1, path2)
+            ))
+        self.assertRaises(ConfigurationError, xmlconfig, config)
+
+        # files and images can't be mixed
+        config = StringIO(template % (
+            """
+            <browser:i18n-resource name="test" defaultLanguage="fr">
+              <browser:translation language="en" file="%s" />
+              <browser:translation language="fr" image="%s" />
+            </browser:i18n-resource>
+            """ % (path1, path2)
+            ))
+        self.assertRaises(ConfigurationError, xmlconfig, config)
+
+
     def testSkinResource(self):
         self.assertEqual(
             queryResource(ob, 'test', request, None),