changeset 51:38afb05e3471

Bind views used to create databases and users to '+' instead that to 'create'.
author Daniele Nicolodi <daniele@grinta.net>
date Sat, 13 Aug 2011 20:27:24 +0200
parents cd44da6ece8d
children cfda4a03b2ae
files src/ltpdarepo/tests/manage-databases.txt src/ltpdarepo/tests/manage-users.txt src/ltpdarepo/views/databases.py src/ltpdarepo/views/users.py
diffstat 4 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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
     '...<li>MySQL already contains a datbase with this ID.</li>...'
 
@@ -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
     '...<li>MySQL already contains a datbase with this ID.</li>...'
 
--- 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
     '...<li>MySQL already contains an user with this username.</li>...'
 
@@ -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
     '...<li>MySQL already contains an user with this username.</li>...'
--- 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()
--- 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()