# HG changeset patch # User Daniele Nicolodi # Date 1313260044 -7200 # Node ID 38afb05e347193bc13966737bc218316407eeef2 # Parent cd44da6ece8d701ebcbd51e30dfe59115e76b811 Bind views used to create databases and users to '+' instead that to 'create'. diff -r cd44da6ece8d -r 38afb05e3471 src/ltpdarepo/tests/manage-databases.txt --- a/src/ltpdarepo/tests/manage-databases.txt Sat Aug 13 20:27:24 2011 +0200 +++ b/src/ltpdarepo/tests/manage-databases.txt Sat Aug 13 20:27:24 2011 +0200 @@ -26,7 +26,7 @@ >>> browser.getLink('Create new database').click() >>> browser.url - 'http://localhost/manage/databases/create' + 'http://localhost/manage/databases/+' >>> browser.getControl(name='id').value = 'database1' >>> browser.getControl(name='submit').click() @@ -63,7 +63,7 @@ >>> browser.getControl(name='id').value = 'database1' >>> browser.getControl(name='submit').click() >>> browser.url - 'http://localhost/manage/databases/create' + 'http://localhost/manage/databases/+' >>> browser.contents '...
  • MySQL already contains a datbase with this ID.
  • ...' @@ -72,7 +72,7 @@ >>> browser.getControl(name='id').value = 'mysql' >>> browser.getControl(name='submit').click() >>> browser.url - 'http://localhost/manage/databases/create' + 'http://localhost/manage/databases/+' >>> browser.contents '...
  • MySQL already contains a datbase with this ID.
  • ...' diff -r cd44da6ece8d -r 38afb05e3471 src/ltpdarepo/tests/manage-users.txt --- a/src/ltpdarepo/tests/manage-users.txt Sat Aug 13 20:27:24 2011 +0200 +++ b/src/ltpdarepo/tests/manage-users.txt Sat Aug 13 20:27:24 2011 +0200 @@ -26,7 +26,7 @@ >>> browser.getLink('Create new user').click() >>> browser.url - 'http://localhost/manage/users/create' + 'http://localhost/manage/users/+' >>> browser.getControl(name='username').value = 'user1' >>> browser.getControl(name='email').value = 'user1@example.org' @@ -115,12 +115,12 @@ It is not possible to create an user with a duplicate username:: - >>> browser.open('/manage/users/create') + >>> browser.open('/manage/users/+') >>> browser.getControl(name='username').value = 'u1' >>> browser.getControl(name='email').value = 'u1@example.org' >>> browser.getControl(name='submit').click() >>> browser.url - 'http://localhost/manage/users/create' + 'http://localhost/manage/users/+' >>> browser.contents '...
  • MySQL already contains an user with this username.
  • ...' @@ -130,6 +130,6 @@ >>> browser.getControl(name='email').value = 'root@example.org' >>> browser.getControl(name='submit').click() >>> browser.url - 'http://localhost/manage/users/create' + 'http://localhost/manage/users/+' >>> browser.contents '...
  • MySQL already contains an user with this username.
  • ...' diff -r cd44da6ece8d -r 38afb05e3471 src/ltpdarepo/views/databases.py --- a/src/ltpdarepo/views/databases.py Sat Aug 13 20:27:24 2011 +0200 +++ b/src/ltpdarepo/views/databases.py Sat Aug 13 20:27:24 2011 +0200 @@ -34,7 +34,7 @@ return render_template('databases/view.html', database=db) -@app.route('/create', methods=['GET', 'POST']) +@app.route('/+', methods=['GET', 'POST']) @require('admin') def create(): form = IDatabase() diff -r cd44da6ece8d -r 38afb05e3471 src/ltpdarepo/views/users.py --- a/src/ltpdarepo/views/users.py Sat Aug 13 20:27:24 2011 +0200 +++ b/src/ltpdarepo/views/users.py Sat Aug 13 20:27:24 2011 +0200 @@ -48,7 +48,7 @@ return render_template('users/edit.html', username=username, form=form) -@app.route('/create', methods=('GET', 'POST')) +@app.route('/+', methods=('GET', 'POST')) @require('admin') def create(): form = IUser()