Log message for revision 112358:
  Add tests for __repr__ of user classes.

Changed:
  U   Zope/branches/2.12/src/AccessControl/tests/testUser.py

-=-
Modified: Zope/branches/2.12/src/AccessControl/tests/testUser.py
===================================================================
--- Zope/branches/2.12/src/AccessControl/tests/testUser.py      2010-05-16 
16:33:54 UTC (rev 112357)
+++ Zope/branches/2.12/src/AccessControl/tests/testUser.py      2010-05-16 
16:48:29 UTC (rev 112358)
@@ -95,7 +95,11 @@
         simple = self._makeOne('phred', roles=())
         self.assertEqual(simple.getRoles(), ('Authenticated',))
 
+    def test___repr__(self):
+        special = self._makeOne()
+        self.assertEqual(repr(special), "<SimpleUser 'admin'>")
 
+
 class SpecialUserTests(unittest.TestCase):
 
     def _getTargetClass(self):
@@ -110,13 +114,17 @@
         return self._getTargetClass()(name, password, roles, domains)
 
     def test_overrides(self):
-        simple = self._makeOne()
-        self.assertEqual(simple.getUserName(), 'admin')
-        self.assertEqual(simple.getId(), None)
-        self.assertEqual(simple._getPassword(), '123')
-        self.assertEqual(simple.getDomains(), ())
+        special = self._makeOne()
+        self.assertEqual(special.getUserName(), 'admin')
+        self.assertEqual(special.getId(), None)
+        self.assertEqual(special._getPassword(), '123')
+        self.assertEqual(special.getDomains(), ())
 
+    def test___repr__(self):
+        special = self._makeOne()
+        self.assertEqual(repr(special), "<SpecialUser 'admin'>")
 
+
 class UnrestrictedUserTests(unittest.TestCase):
 
     def _getTargetClass(self):
@@ -159,7 +167,12 @@
         unrestricted = self._makeOne()
         self.failUnless(unrestricted.has_role(('Manager',), self))
 
+    def test___repr__(self):
+        unrestricted = self._makeOne()
+        self.assertEqual(repr(unrestricted),
+                         "<UnrestrictedUser 'admin'>")
 
+
 class NullUnrestrictedUserTests(unittest.TestCase):
 
     def _getTargetClass(self):

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
https://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to