Permalink
Browse files

new test for registration with password validation plugin

svn path=/plone.app.users/branches/plip10959/; revision=50650
  • Loading branch information...
1 parent 052748f commit acea9f0a4098a54aaf0040739b970bd7f2a0d4a1 Dylan Jay committed Jun 23, 2011
Showing with 38 additions and 0 deletions.
  1. +38 −0 plone/app/users/tests/registration_forms.txt
View
38 plone/app/users/tests/registration_forms.txt
@@ -235,3 +235,41 @@ Testing the flexible user registration
...Reviewers...'
+Now let's test using a PAS Password validation plugin. Add a test plugin.
+
+ >>> self.addPasswordStrength()
+ >>> browser.open('http://nohost/plone/@@new-user')
+
+Check that we are given instructions on what is a valid password
+
+ >>> print browser.contents
+ <...
+ ...Enter your new password. Must not be dead...
+
+
+We'll enter an invalid password
+
+ Fill out the form.
+ >>> browser.getControl('User Name').value = 'user5'
+ >>> browser.getControl('E-mail').value = 'user5@example.com'
+ >>> browser.getControl('Password').value = 'dead parrot'
+ >>> browser.getControl('Confirm password').value = 'dead parrot'
+ >>> browser.getControl('Register').click()
+
+ >>> print browser.contents
+ <...<div class="fieldErrorBox">Must not be dead</div>...
+ >>> print browser.url
+ http://...@@new-user...
+
+
+Now try a valid password
+
+ >>> browser.getControl('Password').value = 'fish'
+ >>> browser.getControl('Confirm password').value = 'fish'
+
+ >>> browser.getControl('Register').click()
+ >>> print browser.url
+ http://...@@usergroup-userprefs...
+ >>> print browser.contents
+ <...User added...user5...
+

0 comments on commit acea9f0

Please sign in to comment.