[CMF-checkins] CVS: CMF/CMFWorkspaces/tests - testReferences.py:1.2
Casey Duncan
casey@zope.com
Fri, 19 Jul 2002 17:01:29 -0400
Update of /cvs-repository/CMF/CMFWorkspaces/tests
In directory cvs.zope.org:/tmp/cvs-serv21763/tests
Modified Files:
testReferences.py
Log Message:
First crack at direct FTP traversal of workspaces
The biggest change is that the ids of references are no longer a numeric sequence. They are uniquified versions of the ids of the objects being referred. Most of the time the workspace id is the same as the referenced object.
This is minimal support. It supports only traversal and not arbitrary PUT handling directly in the workspace. PUTs into referenced subobjects are possible.
=== CMF/CMFWorkspaces/tests/testReferences.py 1.1.1.1 => 1.2 ===
f4 = Folder()
f4.id = 'f4'
self.f1.f2.f4 = f4
+ f4_1 = Folder()
+ f4_1.id = 'f4'
+ self.f1.f4 = f4_1
f1.portal_url = URLTool()
f1.refs = ReferenceCollection()
@@ -47,6 +50,11 @@
self.f1.refs.addReference(self.f1.f2.f3)
self.f1.refs.addReference(self.f1.f2.f4)
self.assertEqual(len(self.f1.refs), 2)
+
+ def testAddSameIds(self):
+ self.f1.refs.addReference(self.f1.f2.f4)
+ self.f1.refs.addReference(self.f1.f4)
+ self.assertEqual(len(self.f1.refs), 2)
def testMappingInterface(self):
self.f1.refs.addReference(self.f1.f2.f3)