[Checkins] SVN: traject/trunk/src/traject/ A fix for non-unicode names.

Martijn Faassen faassen at startifact.com
Wed Oct 28 11:56:07 EDT 2009


Log message for revision 105337:
  A fix for non-unicode names.
  

Changed:
  U   traject/trunk/src/traject/_traject.py
  U   traject/trunk/src/traject/tests.py

-=-
Modified: traject/trunk/src/traject/_traject.py
===================================================================
--- traject/trunk/src/traject/_traject.py	2009-10-28 15:54:30 UTC (rev 105336)
+++ traject/trunk/src/traject/_traject.py	2009-10-28 15:56:07 UTC (rev 105337)
@@ -223,7 +223,7 @@
             if gen_name == ':':
                 name = name[1:]
                 name = variables.pop(name)  
-            model.__name__ = name
+            model.__name__ = unicode(name)
     
             # no more parents we can find, so we're at the root
             if not gen_pattern:

Modified: traject/trunk/src/traject/tests.py
===================================================================
--- traject/trunk/src/traject/tests.py	2009-10-28 15:54:30 UTC (rev 105336)
+++ traject/trunk/src/traject/tests.py	2009-10-28 15:56:07 UTC (rev 105337)
@@ -849,6 +849,15 @@
         patterns.locate(root, employee, default)
         self.assertEquals([u'employee 1 2', u'employees 1'],
                           _calls)
+    def test_inverse_non_unicode_name(self):
+        patterns = self.get_identity_patterns()
+
+        root = Root()
+        employee = identityEmployee(1, 2)
+        patterns.locate(root, employee, default)
+
+        self.assertEquals(u'2', employee.__name__)
+        
     # test behavior of interfaces and overrides with inverse
 
 



More information about the checkins mailing list