Index: main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
===================================================================
--- main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12017)
+++ main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py	(revision 12018)
@@ -107,5 +107,5 @@
         # Set password
         IUserAccount(
-            self.app['customers'][self.customer_id]).setPassword('spwd')
+            self.app['customers'][self.customer_id]).setPassword('cpwd')
 
         self.login_path = 'http://localhost/app/login'
@@ -484,5 +484,5 @@
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl(name="form.password").value = 'cpwd'
         self.browser.getControl("Login").click()
         self.assertMatches(
@@ -511,5 +511,5 @@
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl(name="form.password").value = 'cpwd'
         self.browser.getControl("Login").click()
         self.assertEqual(self.browser.url, self.customer_path)
@@ -554,5 +554,5 @@
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl(name="form.password").value = 'cpwd'
         self.browser.getControl("Login").click()
         self.assertMatches(
@@ -575,5 +575,5 @@
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl(name="form.password").value = 'cpwd'
         self.browser.getControl("Login").click()
         self.assertEqual(self.browser.url, self.customer_path)
@@ -594,5 +594,5 @@
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl(name="form.password").value = 'cpwd'
         self.browser.getControl("Login").click()
         self.assertTrue(
@@ -600,10 +600,10 @@
         # We set the password again
         IUserAccount(
-            self.app['customers'][self.customer_id]).setPassword('spwd')
+            self.app['customers'][self.customer_id]).setPassword('cpwd')
         # Customers can't login if their account is suspended/deactivated
         self.customer.suspended = True
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl(name="form.password").value = 'cpwd'
         self.browser.getControl("Login").click()
         self.assertMatches(
@@ -613,5 +613,5 @@
         self.customer.suspended_comment = u'Aetsch baetsch!'
         self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl(name="form.password").value = 'cpwd'
         self.browser.getControl("Login").click()
         self.assertMatches(
@@ -622,8 +622,8 @@
         # is not expired
         self.app['customers'][self.customer_id].setTempPassword(
-            'anybody', 'temp_spwd')
-        self.browser.open(self.login_path)
-        self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'spwd'
+            'anybody', 'temp_cpwd')
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.customer_id
+        self.browser.getControl(name="form.password").value = 'cpwd'
         self.browser.getControl("Login").click()
         self.assertMatches(
@@ -633,5 +633,5 @@
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'temp_spwd'
+        self.browser.getControl(name="form.password").value = 'temp_cpwd'
         self.browser.getControl("Login").click()
         self.assertMatches(
@@ -652,5 +652,5 @@
         self.browser.open(self.login_path)
         self.browser.getControl(name="form.login").value = self.customer_id
-        self.browser.getControl(name="form.password").value = 'spwd'
+        self.browser.getControl(name="form.password").value = 'cpwd'
         self.browser.getControl("Login").click()
         self.assertMatches(
@@ -825,2 +825,37 @@
             '- K1000000 - removed: %s'
             % document.document_id in logcontent)
+
+    def test_edit_document(self):
+        # Customers can manage documents under certain conditions
+        self.browser.open(self.login_path)
+        self.browser.getControl(name="form.login").value = self.customer_id
+        self.browser.getControl(name="form.password").value = 'cpwd'
+        self.browser.getControl("Login").click()
+        self.assertMatches(
+            '...You logged in...', self.browser.contents)
+        self.browser.getLink("Documents").click()
+        self.browser.getLink("Add document").click()
+        self.browser.getControl(name="doctype").value = ['generic']
+        self.browser.getControl("Create document").click()
+        self.assertTrue('Generic Document created.' in self.browser.contents)
+        document = self.customer['documents']['d102']
+
+        # Document can be edited ...
+        self.browser.getLink("d102").click()
+
+
+        self.browser.open(self.documents_path + '/d102/edit')
+        #self.browser.getLink("Edit").click()
+        self.assertTrue('The requested form is locked' in self.browser.contents)
+
+
+
+
+
+
+
+        self.browser.getControl(name="form.title").value = 'My second doc'
+        self.browser.getControl("Save").click()
+        self.assertTrue('Form has been saved.' in self.browser.contents)
+        self.browser.getLink("View").click()
+        self.assertEqual(self.browser.url, self.documents_path + '/d102/index')
