vendor/Five/1.2b-r20590

view tests/testing/folder.py @ 0:3673ed425f80

Vendor import of Five 1.2b+ (r20590)
author fguillaume
date Fri, 02 Dec 2005 20:25:42 +0000
parents
children
line source
1 ##############################################################################
2 #
3 # Copyright (c) 2004, 2005 Zope Corporation and Contributors.
4 # All Rights Reserved.
5 #
6 # This software is subject to the provisions of the Zope Public License,
7 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
8 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11 # FOR A PARTICULAR PURPOSE.
12 #
13 ##############################################################################
14 """Test folders
16 $Id: folder.py 14468 2005-07-10 11:39:32Z philikon $
17 """
18 from OFS.Folder import Folder
19 from OFS.interfaces import IFolder
20 from zope.interface import implements
21 from Products.Five.traversable import Traversable
23 class NoVerifyPasteFolder(Folder):
24 """Folder that does not perform paste verification.
25 Used by test_events
26 """
27 def _verifyObjectPaste(self, object, validate_src=1):
28 pass
30 def manage_addNoVerifyPasteFolder(container, id, title=''):
31 container._setObject(id, NoVerifyPasteFolder())
32 folder = container[id]
33 folder.id = id
34 folder.title = title
36 class FiveTraversableFolder(Traversable, Folder):
37 """Folder that is five-traversable
38 """
39 implements(IFolder)
41 def manage_addFiveTraversableFolder(container, id, title=''):
42 container._setObject(id, FiveTraversableFolder())
43 folder = container[id]
44 folder.id = id
45 folder.title = title