diff babel/messages/tests/catalog.py @ 315:654b632e5482

Merging catalogs would sometimes mix translations from different runs.
author cmlenz
date Fri, 01 Feb 2008 14:46:32 +0000
parents 5c0bda4f20b1
children 90849c44c531
line wrap: on
line diff
--- a/babel/messages/tests/catalog.py
+++ b/babel/messages/tests/catalog.py
@@ -174,6 +174,17 @@
         cat.update(tmpl, no_fuzzy_matching=True)
         self.assertEqual(2, len(cat.obsolete))
 
+    def test_update_no_template_mutation(self):
+        tmpl = catalog.Catalog()
+        tmpl.add('foo')
+        cat1 = catalog.Catalog()
+        cat1.add('foo', 'Voh')
+        cat1.update(tmpl)
+        cat2 = catalog.Catalog()
+        cat2.update(tmpl)
+
+        self.assertEqual(None, cat2['foo'].string)
+        self.assertEqual(False, cat2['foo'].fuzzy)
 
 def suite():
     suite = unittest.TestSuite()
Copyright (C) 2012-2017 Edgewall Software