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

Florent Guillaume fg@nuxeo.com
Sat, 29 Jun 2002 11:01:56 -0400


Update of /cvs-repository/CMF/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv4660/CMFDefault/tests

Modified Files:
	test_join.py 
Log Message:
Fixed CMFDefault.RegistrationTool to correctly check the lack of 'email'
property when creating a new member or when checking member's properties
validity (Tracker #508).

The fix ensures that the 'email' property is filled in at Join time, and
that a user is not allowed to clear his email (the policy in CMFDefault
seems to be that all members have an email).

I keep the possibility of a user leaving an already-empty password blank
when changing his preferences (for instance if it was removed by the
administrator for some reason, the user can still go change his other
properties).



=== CMF/CMFDefault/tests/test_join.py 1.5 => 1.6 ===
                         , "private" )
 
+    def test_join_without_email( self ):
+        self.root.manage_addProduct[ 'CMFDefault' ].manage_addCMFSite( 'site' )
+        site = self.root.site
+        self.assertRaises(ValueError,
+                          site.portal_registration.addMember,
+                          'test_user',
+                          'zzyyzz',
+                          properties={'username':'test_user', 'email': ''}
+                          )
 
 def test_suite():
     return TestSuite((