-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dmitry Vasiliev
committed
Oct 24, 2005
0 parents
commit ea3acae
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
############################################################################## | ||
# | ||
# Copyright (c) 2002 Zope Corporation and Contributors. | ||
# All Rights Reserved. | ||
# | ||
# This software is subject to the provisions of the Zope Public License, | ||
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. | ||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED | ||
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS | ||
# FOR A PARTICULAR PURPOSE. | ||
# | ||
############################################################################## | ||
"""Unit test logic for setting up and tearing down basic infrastructure | ||
$Id$ | ||
""" | ||
from zope.app.testing import ztapi | ||
from zope.schema.vocabulary import setVocabularyRegistry | ||
from zope.component.tests.placelesssetup \ | ||
import PlacelessSetup as CAPlacelessSetup | ||
from zope.app.event.tests.placelesssetup \ | ||
import PlacelessSetup as EventPlacelessSetup | ||
from zope.app.i18n.tests.placelesssetup \ | ||
import PlacelessSetup as I18nPlacelessSetup | ||
from zope.app.container.tests.placelesssetup \ | ||
import PlacelessSetup as ContainerPlacelessSetup | ||
from zope.app.authentication.placelesssetup \ | ||
import PlacelessSetup as AuthenticationPlacelessSetup | ||
from zope.app.security._protections import protect | ||
from zope.app.traversing.browser.interfaces import IAbsoluteURL | ||
from zope.app.traversing.browser.absoluteurl import AbsoluteURL | ||
|
||
class PlacelessSetup(CAPlacelessSetup, | ||
EventPlacelessSetup, | ||
I18nPlacelessSetup, | ||
ContainerPlacelessSetup, | ||
AuthenticationPlacelessSetup | ||
): | ||
|
||
def setUp(self, doctesttest=None): | ||
CAPlacelessSetup.setUp(self) | ||
ContainerPlacelessSetup.setUp(self) | ||
EventPlacelessSetup.setUp(self) | ||
I18nPlacelessSetup.setUp(self) | ||
AuthenticationPlacelessSetup.setUp(self) | ||
# Register app-specific security declarations | ||
protect() | ||
|
||
ztapi.browserView(None, 'absolute_url', AbsoluteURL) | ||
ztapi.browserViewProviding(None, AbsoluteURL, IAbsoluteURL) | ||
|
||
from zope.app.security.tests import addCheckerPublic | ||
addCheckerPublic() | ||
|
||
from zope.security.management import newInteraction | ||
newInteraction() | ||
|
||
setVocabularyRegistry(None) | ||
|
||
|
||
ps = PlacelessSetup() | ||
setUp = ps.setUp | ||
|
||
def tearDown(): | ||
tearDown_ = ps.tearDown | ||
def tearDown(doctesttest=None): | ||
tearDown_() | ||
return tearDown | ||
|
||
tearDown = tearDown() | ||
|
||
del ps |