[Checkins] SVN: Acquisition/branches/zagy-unicode-should-be-called/src/Acquisition/tests.py added another test to really make sure __str__ is being called when there is no

Christian Zagrodnick cz at gocept.com
Thu Feb 17 02:25:48 EST 2011


Log message for revision 120411:
  added another test to really make sure __str__ is being called when there is no
  __unicode__
  
  

Changed:
  U   Acquisition/branches/zagy-unicode-should-be-called/src/Acquisition/tests.py

-=-
Modified: Acquisition/branches/zagy-unicode-should-be-called/src/Acquisition/tests.py
===================================================================
--- Acquisition/branches/zagy-unicode-should-be-called/src/Acquisition/tests.py	2011-02-17 06:27:06 UTC (rev 120410)
+++ Acquisition/branches/zagy-unicode-should-be-called/src/Acquisition/tests.py	2011-02-17 07:25:48 UTC (rev 120411)
@@ -2454,7 +2454,14 @@
                 return u'unicode was called'
         self.assertEqual(u'unicode was called', unicode(A().__of__(A())))
 
+    def test_should_fall_back_to_str(self):
+        class A(Acquisition.Explicit):
+            def __str__(self):
+                return 'str was called'
+        self.assertEqual(u'str was called', unicode(A().__of__(A())))
 
+
+
 def test_suite():
     return unittest.TestSuite((
         DocTestSuite(),



More information about the checkins mailing list