[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container/tests - test_contents.py:1.21

Jim Fulton jim@zope.com
Thu, 12 Jun 2003 05:31:19 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/container/tests
In directory cvs.zope.org:/tmp/cvs-serv26395/src/zope/app/browser/container/tests

Modified Files:
	test_contents.py 
Log Message:
Significantly refactored the contents view:

- Ported the basic template from the rotterdam skin.
  In-place add now works for all uses of this view.

- Added in-place rename.  When the rename button is selected, the
  contents are redisplated with the ids for the selected items
  displayed as text inputs.

  In addition, in the normal contents display, if you click just after
  a name, the contents will be redisplayed with than name editable.

- Added in-place title editing. Clicking on a title (or the locatioon
  where a title would be displayed), causes the contents to be
  redisplayed with a text field for editing the title.

- When performing an in-place operation, submit and cancel buttons are
  displayed rather than the normal buttons.

- The view is now a self-posting form with a single url.


=== Zope3/src/zope/app/browser/container/tests/test_contents.py 1.20 => 1.21 ===
--- Zope3/src/zope/app/browser/container/tests/test_contents.py:1.20	Mon Jun  9 12:39:11 2003
+++ Zope3/src/zope/app/browser/container/tests/test_contents.py	Thu Jun 12 05:30:49 2003
@@ -145,7 +145,9 @@
            )
         clearEvents()
 
-        fc.removeObjects(['document2'])
+        fc.request.form.update({'ids': ['document2']})
+
+        fc.removeObjects()
 
         self.failUnless(
             getEvents(IObjectRemovedEvent,
@@ -213,7 +215,10 @@
         for id in ids:
             document = Document()
             container.setObject(id, document)
-        fc.renameObjects(ids, ['document1_1', 'document2_2'])
+        fc.request.form.update({'rename_ids': ids,
+                                'new_value': ['document1_1', 'document2_2']
+                                })
+        fc.renameObjects()
         self.failIf('document1_1' not in container)
         self.failIf('document1' in container)
 
@@ -224,7 +229,9 @@
         for id in ids:
             document = Document()
             container.setObject(id, document)
-        fc.copyObjects(ids)
+
+        fc.request.form['ids'] = ids
+        fc.copyObjects()
         fc.pasteObjects()
         self.failIf('document1' not in container)
         self.failIf('document2' not in container)
@@ -235,7 +242,8 @@
         container = traverse(self.rootFolder, 'folder1')
         fc = self._TestView__newView(container)
         ids = ['folder1_1']
-        fc.copyObjects(ids)
+        fc.request.form['ids'] = ids
+        fc.copyObjects()
         fc.pasteObjects()
         self.failIf('folder1_1' not in container)
         self.failIf('copy_of_folder1_1' not in container)
@@ -244,7 +252,8 @@
         container = traverse(self.rootFolder, '/folder1/folder1_1')
         fc = self._TestView__newView(container)
         ids = ['folder1_1_1']
-        fc.copyObjects(ids)
+        fc.request.form['ids'] = ids
+        fc.copyObjects()
         fc.pasteObjects()
         self.failIf('folder1_1_1' not in container)
         self.failIf('copy_of_folder1_1_1' not in container)
@@ -255,7 +264,8 @@
         fc = self._TestView__newView(container)
         tg = self._TestView__newView(target)
         ids = ['folder1_1_1']
-        fc.copyObjects(ids)
+        fc.request.form['ids'] = ids
+        fc.copyObjects()
         tg.pasteObjects()
         self.failIf('folder1_1_1' not in container)
         self.failIf('folder1_1_1' not in target)
@@ -267,7 +277,8 @@
         for id in ids:
             document = Document()
             container.setObject(id, document)
-        fc.cutObjects(ids)
+        fc.request.form['ids'] = ids
+        fc.cutObjects()
         fc.pasteObjects()
         self.failIf('document1' not in container)
         self.failIf('document2' not in container)
@@ -276,7 +287,8 @@
         container = traverse(self.rootFolder, 'folder1')
         fc = self._TestView__newView(container)
         ids = ['folder1_1']
-        fc.cutObjects(ids)
+        fc.request.form['ids'] = ids
+        fc.cutObjects()
         fc.pasteObjects()
         self.failIf('folder1_1' not in container)
 
@@ -284,7 +296,8 @@
         container = traverse(self.rootFolder, '/folder1/folder1_1')
         fc = self._TestView__newView(container)
         ids = ['folder1_1_1']
-        fc.cutObjects(ids)
+        fc.request.form['ids'] = ids
+        fc.cutObjects()
         fc.pasteObjects()
         self.failIf('folder1_1_1' not in container)
 
@@ -294,7 +307,8 @@
         fc = self._TestView__newView(container)
         tg = self._TestView__newView(target)
         ids = ['folder1_1_1']
-        fc.cutObjects(ids)
+        fc.request.form['ids'] = ids
+        fc.cutObjects()
         tg.pasteObjects()
         self.failIf('folder1_1_1' in container)
         self.failIf('folder1_1_1' not in target)