[CMF-checkins] CVS: Products/CMFDefault/tests - test_join.py:1.11.8.1

Jens Vagelpohl jens at dataflake.org
Fri Oct 29 10:37:37 EDT 2004


Update of /cvs-repository/Products/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv31186/CMFDefault/tests

Modified Files:
      Tag: CMF-1_5-branch
	test_join.py 
Log Message:
- RegistrationTool: The regular expression that limits what people
  can put in as a valid member ID is now configurable TTW in the
  portal_registration tool (http://www.zope.org/Collectors/CMF/117)


=== Products/CMFDefault/tests/test_join.py 1.11 => 1.11.8.1 ===
--- Products/CMFDefault/tests/test_join.py:1.11	Mon Apr 26 08:14:18 2004
+++ Products/CMFDefault/tests/test_join.py	Fri Oct 29 10:37:36 2004
@@ -31,6 +31,34 @@
                           properties={'username':'test_user', 'email': ''}
                           )
 
+    def test_join_with_variable_id_policies( self ):
+        self.root.manage_addProduct[ 'CMFDefault' ].manage_addCMFSite( 'site' )
+        site = self.root.site
+        member_id = 'test.user'
+
+        # Test with the default policy: Names with "." should fail
+        self.assertRaises(ValueError,
+                          site.portal_registration.addMember,
+                          member_id,
+                          'zzyyzz',
+                          properties={ 'username':'Test User'
+                                     , 'email': 'foo at bar.com'
+                                     }
+                          )
+
+        # Now change the policy to allow "."
+        #import pdb; pdb.set_trace()
+        new_pattern = "^[A-Za-z][A-Za-z0-9_\.]*$"
+        site.portal_registration.manage_editIDPattern(new_pattern)
+        site.portal_registration.addMember( member_id
+                                          , 'zzyyzz'
+                                          , properties={ 'username': 'TestUser2'
+                                                       , 'email' : 'foo at bar.com'
+                                                       }
+                                          )
+        u = site.acl_users.getUser(member_id)
+        self.failUnless(u)
+
 
 def test_suite():
     return TestSuite((



More information about the CMF-checkins mailing list