[Zope3-checkins]
CVS: Zope3/src/zope/app/services/pluggableauth/tests
- test_pluggableauth.py:1.7
Jim Fulton
cvs-admin at zope.org
Fri Nov 21 12:12:45 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/services/pluggableauth/tests
In directory cvs.zope.org:/tmp/cvs-serv31883/src/zope/app/services/pluggableauth/tests
Modified Files:
test_pluggableauth.py
Log Message:
Changed to use the new ztapi module, which provides handy functions
for setting up adapters and views for tests. This is needed because
there are no-longer global adapter and view services sitting around as
module globals.
=== Zope3/src/zope/app/services/pluggableauth/tests/test_pluggableauth.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/services/pluggableauth/tests/test_pluggableauth.py:1.6 Sun Sep 21 13:33:05 2003
+++ Zope3/src/zope/app/services/pluggableauth/tests/test_pluggableauth.py Fri Nov 21 12:12:13 2003
@@ -16,6 +16,7 @@
"""
from unittest import TestCase, TestSuite, main, makeSuite
+from zope.app.tests import ztapi
from zope.app.services.auth import User
from zope.app.services.servicenames import Adapters
from zope.app.services.tests import placefulsetup
@@ -23,7 +24,6 @@
from zope.exceptions import NotFoundError
from zope.publisher.interfaces.http import IHTTPCredentials
from zope.app.tests import setup
-from zope.publisher.interfaces.browser import IBrowserPresentation
from zope.exceptions import NotFoundError
from zope.app.services.pluggableauth import BTreePrincipalSource, \
@@ -44,18 +44,16 @@
class Setup(placefulsetup.PlacefulSetup, TestCase):
def setUp(self):
- from zope.component.view import viewService
from zope.app.interfaces.services.pluggableauth import IPrincipalSource
sm = placefulsetup.PlacefulSetup.setUp(self, site=True)
from zope.component import getService
from zope.app.security.basicauthadapter import BasicAuthAdapter
from zope.app.interfaces.security import ILoginPassword
- getService(None, Adapters).provideAdapter(
+ ztapi.provideAdapter(
IHTTPCredentials, ILoginPassword, BasicAuthAdapter)
- viewService.provideView(IPrincipalSource, "login",
- IBrowserPresentation,
- (PrincipalAuthenticationView,))
+ ztapi.browserView(IPrincipalSource, "login",
+ (PrincipalAuthenticationView,))
auth = setup.addService(sm, "TestPluggableAuthenticationService",
PluggableAuthenticationService())
More information about the Zope3-Checkins
mailing list