[Zope-CVS] CVS: Products/PluggableAuthService/plugins/tests - test_ZODBUserManager.py:1.6.8.1

Zachery Bir zbir at urbanape.com
Fri May 27 14:33:52 EDT 2005


Update of /cvs-repository/Products/PluggableAuthService/plugins/tests
In directory cvs.zope.org:/tmp/cvs-serv7730

Modified Files:
      Tag: zbir_fixing_ids_branch
	test_ZODBUserManager.py 
Log Message:
Test the new internal id mangling.


=== Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py 1.6 => 1.6.8.1 ===
--- Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py:1.6	Sat Oct 16 16:15:46 2004
+++ Products/PluggableAuthService/plugins/tests/test_ZODBUserManager.py	Fri May 27 14:33:42 2005
@@ -357,6 +357,31 @@
         self.assertEqual( user_id, 'new_user' )
         self.assertEqual( login, 'new_user at example.com' )
 
+    def test_enumerateUsersWithOptionalMangling(self):
+
+        zum = self._makeOne()
+        zum.prefix = 'special__'
+
+        zum.addUser('user', 'login', 'password')
+        info = zum.enumerateUsers(login='login')
+        self.assertEqual(info[0]['id'], 'special__user')
+
+    def test_getUserByIdWithOptionalMangling(self):
+
+        zum = self._makeOne()
+        zum.prefix = 'special__'
+
+        zum.addUser('user', 'login', 'password')
+
+        info = zum.enumerateUsers(id='user', exact_match=True)
+        self.assertEqual(len(info), 0)
+
+        info = zum.enumerateUsers(id='special__user', exact_match=True)
+        self.assertEqual(info[0]['id'], 'special__user')
+
+        info = zum.enumerateUsers(id='special__luser', exact_match=True)
+        self.assertEqual(len(info), 0)
+
 
 if __name__ == "__main__":
     unittest.main()



More information about the Zope-CVS mailing list