# HG changeset patch # User Daniele Nicolodi # Date 1313943447 -7200 # Node ID 65c700a145c9a6080907fe05fb63ba9ad0e63950 # Parent 8fd53ae8818ad16df696536f84995bf2f2aaa2fb Cleanup and extend doctests. diff -r 8fd53ae8818a -r 65c700a145c9 src/ltpdarepo/tests/browse-database.txt --- a/src/ltpdarepo/tests/browse-database.txt Sun Aug 21 18:17:27 2011 +0200 +++ b/src/ltpdarepo/tests/browse-database.txt Sun Aug 21 18:17:27 2011 +0200 @@ -34,7 +34,6 @@ >>> browser.open('/browse/db1/1/mat') Traceback (most recent call last): - ... HTTPError: HTTP Error 404: NOT FOUND Simple search:: @@ -66,3 +65,7 @@ >>> browser.url 'http://localhost/browse/db1/activity' + +# Local Variables: +# mode: doctest +# End: diff -r 8fd53ae8818a -r 65c700a145c9 src/ltpdarepo/tests/browse-user.txt --- a/src/ltpdarepo/tests/browse-user.txt Sun Aug 21 18:17:27 2011 +0200 +++ b/src/ltpdarepo/tests/browse-user.txt Sun Aug 21 18:17:27 2011 +0200 @@ -61,6 +61,20 @@ >>> browser.url 'http://localhost/user/u1' +Password and confirm fields should have the same value:: + + >>> browser.getLink('Change password').click() + >>> browser.url + 'http://localhost/user/u1/password' + + >>> browser.getControl(name='password').value = 'new' + >>> browser.getControl(name='confirm').value = 'old' + >>> browser.getControl(name='submit').click() + >>> browser.url + 'http://localhost/user/u1/password' + >>> browser.contents + '...Passwords do not match....' + Logout and login again with the new credentials:: >>> browser.getLink('logout').click() @@ -77,7 +91,6 @@ >>> browser.open('/user/u2') Traceback (most recent call last): - ... HTTPError: HTTP Error 403: ... Check that we can not edit someone else profile:: @@ -87,15 +100,17 @@ >>> browser.open('/user/u2') Traceback (most recent call last): - ... HTTPError: HTTP Error 403: ... >>> browser.open('/user/u2/edit') Traceback (most recent call last): - ... HTTPError: HTTP Error 403: ... >>> browser.open('/user/u2/password') Traceback (most recent call last): - ... HTTPError: HTTP Error 403: ... + + +# Local Variables: +# mode: doctest +# End: diff -r 8fd53ae8818a -r 65c700a145c9 src/ltpdarepo/tests/manage-databases.txt --- a/src/ltpdarepo/tests/manage-databases.txt Sun Aug 21 18:17:27 2011 +0200 +++ b/src/ltpdarepo/tests/manage-databases.txt Sun Aug 21 18:17:27 2011 +0200 @@ -56,6 +56,17 @@ >>> browser.contents '...

Description: Test Database One

...' +Cannot create database with bad id:: + + >>> browser.open('/manage/databases/') + >>> browser.getLink('Create database').click() + >>> browser.getControl(name='id').value = '#' + >>> browser.getControl(name='submit').click() + >>> browser.url + 'http://localhost/manage/databases/+' + >>> browser.contents + '...Invalid ID....' + Cannot create database with duplicate id:: >>> browser.open('/manage/databases/') @@ -99,3 +110,7 @@ >>> browser.contents '...
Database "database1" deleted.
...' + +# Local Variables: +# mode: doctest +# End: diff -r 8fd53ae8818a -r 65c700a145c9 src/ltpdarepo/tests/manage-users.txt --- a/src/ltpdarepo/tests/manage-users.txt Sun Aug 21 18:17:27 2011 +0200 +++ b/src/ltpdarepo/tests/manage-users.txt Sun Aug 21 18:17:27 2011 +0200 @@ -9,7 +9,7 @@ >>> browser.open('/') >>> browser.url 'http://localhost/login' - + >>> browser.getControl(name='username').value = USERNAME >>> browser.getControl(name='password').value = PASSWORD >>> browser.getControl(name='login').click() @@ -22,6 +22,13 @@ >>> browser.url 'http://localhost/manage/users/' +View user profile:: + + >>> browser.getLink('u1', index=1).click() + >>> browser.url + 'http://localhost/manage/users/u1' + >>> browser.goBack() + Create a new user:: >>> browser.getLink('Create new user').click() @@ -164,3 +171,8 @@ 'http://localhost/manage/users/+' >>> browser.contents '...MySQL already contains an user with this username....' + + +# Local Variables: +# mode: doctest +# End: