[Checkins] SVN: zmi.core/trunk/s Copy browser packages from zope.app.security and zope.app.localpermission.

Yusei Tahara yusei at domen.cx
Sat Nov 21 03:18:28 EST 2009


Log message for revision 105939:
  Copy browser packages from zope.app.security and zope.app.localpermission.
  

Changed:
  U   zmi.core/trunk/setup.py
  U   zmi.core/trunk/src/zmi/core/configure.zcml
  A   zmi.core/trunk/src/zmi/core/security/__init__.py
  A   zmi.core/trunk/src/zmi/core/security/auth.py
  A   zmi.core/trunk/src/zmi/core/security/authutilitysearchview.pt
  A   zmi.core/trunk/src/zmi/core/security/authutilitysearchview.txt
  A   zmi.core/trunk/src/zmi/core/security/configure.zcml
  A   zmi.core/trunk/src/zmi/core/security/localpermission.zcml
  A   zmi.core/trunk/src/zmi/core/security/login.pt
  A   zmi.core/trunk/src/zmi/core/security/login_failed.pt
  A   zmi.core/trunk/src/zmi/core/security/loginlogout.txt
  A   zmi.core/trunk/src/zmi/core/security/logout.pt
  A   zmi.core/trunk/src/zmi/core/security/principalterms.py
  A   zmi.core/trunk/src/zmi/core/security/redirect.pt
  A   zmi.core/trunk/src/zmi/core/security/tests.py

-=-
Modified: zmi.core/trunk/setup.py
===================================================================
--- zmi.core/trunk/setup.py	2009-11-21 08:10:15 UTC (rev 105938)
+++ zmi.core/trunk/setup.py	2009-11-21 08:18:28 UTC (rev 105939)
@@ -66,6 +66,8 @@
                         'zope.app.onlinehelp',
                         'zope.app.preference',
                         'zope.app.principalannotation',
+                        'zope.app.security',
+                        'zope.app.localpermission',
                         'zope.app.securitypolicy',
                         'zope.app.session',
                         'zope.app.sqlscript',

Modified: zmi.core/trunk/src/zmi/core/configure.zcml
===================================================================
--- zmi.core/trunk/src/zmi/core/configure.zcml	2009-11-21 08:10:15 UTC (rev 105938)
+++ zmi.core/trunk/src/zmi/core/configure.zcml	2009-11-21 08:18:28 UTC (rev 105939)
@@ -17,6 +17,7 @@
   <include package=".onlinehelp" />
   <include package=".preference" />
   <include package=".principalannotation" />
+  <include package=".security" />
   <include package=".securitypolicy" />
   <include package=".session" />
   <include package=".sqlscript" />

Added: zmi.core/trunk/src/zmi/core/security/__init__.py
===================================================================
--- zmi.core/trunk/src/zmi/core/security/__init__.py	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/__init__.py	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,17 @@
+##############################################################################
+#
+# Copyright (c) 2004 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.
+#
+##############################################################################
+"""Security Views
+
+$Id: __init__.py 29365 2005-03-01 18:32:59Z sidnei $
+"""

Added: zmi.core/trunk/src/zmi/core/security/auth.py
===================================================================
--- zmi.core/trunk/src/zmi/core/security/auth.py	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/auth.py	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,140 @@
+##############################################################################
+#
+# Copyright (c) 2003 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.
+#
+##############################################################################
+"""Login and Logout screens
+
+$Id: auth.py 97952 2009-03-12 03:23:55Z nadako $
+"""
+import urllib
+
+from zope import component
+from zope.app.pagetemplate import ViewPageTemplateFile
+from zope.app.publisher.interfaces.http import ILogin
+from zope.authentication.interfaces import IAuthentication
+from zope.authentication.interfaces import IUnauthenticatedPrincipal
+from zope.authentication.interfaces import ILogout, ILogoutSupported
+from zope.i18n import translate
+from zope.interface import implements
+
+from zope.app.security.i18n import _
+
+
+class AuthUtilitySearchView(object):
+
+    template = ViewPageTemplateFile('authutilitysearchview.pt')
+    searchTitle = u'principals.zcml'
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    def render(self, name):
+        return self.template(title=self.searchTitle, name=name)
+
+    def results(self, name):
+        if not (name+'.search' in self.request):
+            return None
+        searchstring = self.request[name+'.searchstring']
+        return [principal.id
+                for principal in self.context.getPrincipals(searchstring)]
+
+
+class HTTPAuthenticationLogin(object):
+
+    implements(ILogin)
+
+    confirmation = ViewPageTemplateFile('login.pt')
+
+    failed = ViewPageTemplateFile('login_failed.pt')
+
+    def login(self, nextURL=None):
+        # we don't want to keep challenging if we're authenticated
+        if IUnauthenticatedPrincipal.providedBy(self.request.principal):
+            component.getUtility(IAuthentication).unauthorized(
+                self.request.principal.id, self.request)
+            return self.failed()
+        else:
+            if nextURL is None:
+                return self.confirmation()
+            else:
+                self.request.response.redirect(nextURL)
+
+
+class HTTPBasicAuthenticationLogin(HTTPAuthenticationLogin):
+    """Issues a challenge to the browser to get basic auth credentials.
+
+    This view can be used as a fail safe login in the even the normal login
+    fails because of an improperly configured authentication utility.
+
+    The failsafeness of this view relies on the fact that the global principal
+    registry, which typically contains an adminitrator principal, uses basic
+    auth credentials to authenticate.
+    """
+    def login(self, nextURL=None):
+        # we don't want to keep challenging if we're authenticated
+        if IUnauthenticatedPrincipal.providedBy(self.request.principal):
+            # hard-code basic auth challenge
+            self.request.unauthorized('basic realm="Zope"')
+            return self.failed()
+        else:
+            if nextURL is None:
+                return self.confirmation()
+            else:
+                self.request.response.redirect(nextURL)
+
+
+class HTTPAuthenticationLogout(object):
+    """Since HTTP Authentication really does not know about logout, we are
+    simply challenging the client again."""
+
+    implements(ILogout)
+
+    confirmation = ViewPageTemplateFile('logout.pt')
+
+    redirect = ViewPageTemplateFile('redirect.pt')
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    def logout(self, nextURL=None):
+        if not IUnauthenticatedPrincipal.providedBy(self.request.principal):
+            auth = component.getUtility(IAuthentication)
+            ILogout(auth).logout(self.request)
+            if nextURL:
+                return self.redirect()
+        if nextURL is None:
+            return self.confirmation()
+        else:
+            return self.request.response.redirect(nextURL)
+
+
+class LoginLogout(object):
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    def __call__(self):
+        if IUnauthenticatedPrincipal.providedBy(self.request.principal):
+            return u'<a href="@@login.html?nextURL=%s">%s</a>' % (
+                urllib.quote(self.request.getURL()),
+                translate(_('[Login]'), context=self.request,
+                          default='[Login]'))
+        elif ILogoutSupported(self.request, None) is not None:
+            return u'<a href="@@logout.html?nextURL=%s">%s</a>' % (
+                urllib.quote(self.request.getURL()),
+                translate(_('[Logout]'), context=self.request,
+                          default='[Logout]'))
+        else:
+            return None

Added: zmi.core/trunk/src/zmi/core/security/authutilitysearchview.pt
===================================================================
--- zmi.core/trunk/src/zmi/core/security/authutilitysearchview.pt	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/authutilitysearchview.pt	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,21 @@
+<tal:block i18n:domain="zope">
+	<h4 tal:content="options/title" i18n:translate="">principals.zcml</h4>
+	<div class="row">
+		<div class="label" i18n:translate="">
+			Search String
+		</div>
+		<div class="field">
+			<input type="text" name="some.searchstring"
+			       tal:attributes="name string:${options/name}.searchstring"
+			       />
+		</div>
+	</div>
+	<div class="row">
+		<div class="field">
+			<input type="submit" name="some.search" value="Search"
+			       tal:attributes="name string:${options/name}.search"
+			       i18n:attributes="value search-button"
+			       />
+		</div>
+	</div>
+</tal:block>

Added: zmi.core/trunk/src/zmi/core/security/authutilitysearchview.txt
===================================================================
--- zmi.core/trunk/src/zmi/core/security/authutilitysearchview.txt	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/authutilitysearchview.txt	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,68 @@
+===========================================
+The Query View for Authentication Utilities
+===========================================
+
+A regular authentication service will not provide the `ISourceQueriables`
+interface, but it is a queriable itself, since it provides the simple
+`getPrincipals(name)` method:
+
+  >>> class Principal:
+  ...     def __init__(self, id):
+  ...         self.id = id
+
+  >>> class MyAuthUtility:
+  ...     data = {'jim': Principal(42), 'don': Principal(0),
+  ...             'stephan': Principal(1)}
+  ...
+  ...     def getPrincipals(self, name):
+  ...         return [principal
+  ...                 for id, principal in self.data.items()
+  ...                 if name in id]
+
+Now that we have our queriable, we create the view for it:
+
+  >>> from zmi.core.security.auth import AuthUtilitySearchView
+  >>> from zope.publisher.browser import TestRequest
+  >>> request = TestRequest()
+  >>> view = AuthUtilitySearchView(MyAuthUtility(), request)
+
+This allows us to render a search form.
+
+  >>> print view.render('test') # doctest: +NORMALIZE_WHITESPACE
+  <h4>principals.zcml</h4>
+  <div class="row">
+  <div class="label">
+  Search String
+  </div>
+  <div class="field">
+  <input type="text" name="test.searchstring" />
+  </div>
+  </div>
+  <div class="row">
+  <div class="field">
+  <input type="submit" name="test.search" value="Search" />
+  </div>
+  </div>
+
+If we ask for results:
+
+  >>> view.results('test')
+
+We don't get any, since we did not provide any. But if we give input:
+
+  >>> request.form['test.searchstring'] = 'n'
+
+we still don't get any:
+
+  >>> view.results('test')
+
+because we did not press the button. So let's press the button:
+
+  >>> request.form['test.search'] = 'Search'
+
+so that we now get results (!):
+
+  >>> ids = list(view.results('test'))
+  >>> ids.sort()
+  >>> ids
+  [0, 1]


Property changes on: zmi.core/trunk/src/zmi/core/security/authutilitysearchview.txt
___________________________________________________________________
Added: svn:eol-style
   + native

Added: zmi.core/trunk/src/zmi/core/security/configure.zcml
===================================================================
--- zmi.core/trunk/src/zmi/core/security/configure.zcml	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/configure.zcml	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,49 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:browser="http://namespaces.zope.org/browser">
+
+
+  <adapter
+      for="zope.authentication.interfaces.IAuthentication
+           zope.publisher.interfaces.browser.IBrowserRequest"
+      provides="zope.app.form.browser.interfaces.ISourceQueryView"
+      factory="zmi.core.security.auth.AuthUtilitySearchView"
+      />
+
+  <browser:page
+      name="failsafelogin.html"
+      for="*"
+      class=".auth.HTTPBasicAuthenticationLogin"
+      attribute="login"
+      permission="zope.Public"
+      allowed_interface="zope.app.publisher.interfaces.http.ILogin"
+      />
+
+  <browser:page
+      name="login.html"
+      for="*"
+      class=".auth.HTTPAuthenticationLogin"
+      attribute="login"
+      permission="zope.Public"
+      allowed_interface="zope.app.publisher.interfaces.http.ILogin"
+      />
+
+  <browser:page
+      name="logout.html"
+      for="*"
+      class=".auth.HTTPAuthenticationLogout"
+      attribute="logout"
+      permission="zope.Public"
+      allowed_interface="zope.app.publisher.interfaces.http.ILogout"
+      />
+
+  <browser:page
+      name="login_logout"
+      for="*"
+      class=".auth.LoginLogout"
+      permission="zope.Public"
+      />
+
+  <include file="localpermission.zcml" />
+
+</configure>

Added: zmi.core/trunk/src/zmi/core/security/localpermission.zcml
===================================================================
--- zmi.core/trunk/src/zmi/core/security/localpermission.zcml	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/localpermission.zcml	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,30 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:browser="http://namespaces.zope.org/browser"
+   >
+
+  <browser:addform
+     name="AddPermission.html"
+     schema="zope.security.interfaces.IPermission"
+     label="Add Permission"
+     content_factory="zope.app.localpermission.permission.LocalPermission"
+     fields="title description"
+     permission="zope.Security"
+     />
+
+  <browser:addMenuItem
+     title="Permission"
+     description="A Security Permission"
+     class="zope.app.localpermission.permission.LocalPermission"
+     permission="zope.ManageServices"
+     view="AddPermission.html"
+     />
+
+  <browser:editform
+      schema="zope.security.interfaces.IPermission"
+      label="Edit Permission"
+      name="edit.html"
+      permission="zope.ManageServices"
+      menu="zmi_views" title="Edit" />
+
+</configure>

Added: zmi.core/trunk/src/zmi/core/security/login.pt
===================================================================
--- zmi.core/trunk/src/zmi/core/security/login.pt	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/login.pt	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,19 @@
+<html metal:use-macro="context/@@standard_macros/page"
+    i18n:domain="zope">
+  <body>
+  <div metal:fill-slot="body">
+  
+     <h1 i18n:translate="">Login successful!</h1>
+
+     <p style="font-size: 200%" i18n:translate="">
+       You are now logged in as 
+       <em tal:content="view/request/principal/title" 
+           i18n:name="UserTitle">Joe Smith</em>.
+     </p>
+
+     <a href="." i18n:translate="">Back to the main page.</a>
+
+  </div>
+  </body>
+
+</html>

Added: zmi.core/trunk/src/zmi/core/security/login_failed.pt
===================================================================
--- zmi.core/trunk/src/zmi/core/security/login_failed.pt	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/login_failed.pt	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,18 @@
+<html metal:use-macro="context/@@standard_macros/page"
+    i18n:domain="zope">
+  <body>
+  <div metal:fill-slot="body">
+
+     <h1 i18n:translate="">Login Failed!</h1>
+
+     <p style="font-size: 150%">
+       <tal:block
+            i18n:translate="">You cancelled the login procedure.</tal:block>
+       <a tal:attributes="href python: view.request.get('nextURL', '.')"
+            i18n:translate="">Click here to return.</a>
+     </p>
+
+  </div>
+  </body>
+
+</html>

Added: zmi.core/trunk/src/zmi/core/security/loginlogout.txt
===================================================================
--- zmi.core/trunk/src/zmi/core/security/loginlogout.txt	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/loginlogout.txt	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,71 @@
+====================
+Login/Logout Snippet
+====================
+
+The class LoginLogout:
+
+  >>> from zmi.core.security.auth import LoginLogout
+
+is used as a view to generate an HTML snippet suitable for logging in or
+logging out based on whether or not the current principal is authenticated.
+
+When the current principal is unauthenticated, it provides
+IUnauthenticatedPrincipal:
+
+  >>> from zope.authentication.interfaces import IUnauthenticatedPrincipal
+  >>> from zope.principalregistry.principalregistry import UnauthenticatedPrincipal
+  >>> anonymous = UnauthenticatedPrincipal('anon', '', '')
+  >>> IUnauthenticatedPrincipal.providedBy(anonymous)
+  True
+
+When LoginLogout is used for a request that has an unauthenticated principal,
+it provides the user with a link to 'Login':
+
+  >>> from zope.publisher.browser import TestRequest
+  >>> request = TestRequest()
+  >>> request.setPrincipal(anonymous)
+  >>> LoginLogout(None, request)()
+  u'<a href="@@login.html?nextURL=http%3A//127.0.0.1">[Login]</a>'
+
+Logout, however, behaves differently. Not all authentication protocols (i.e.
+credentials extractors/challengers) support 'logout'. Furthermore, we don't
+know how an admin may have configured Zope's authentication. Our solution is
+to rely on the admin to tell us explicitly that the site supports logout.
+
+By default, the LoginLogout snippet will not provide a logout link for an
+unauthenticated principal. To illustrate, we'll first setup a request with an
+unauthenticated principal:
+
+  >>> from zope.security.interfaces import IPrincipal
+  >>> from zope.interface import implements
+  >>> class Bob:
+  ...     implements(IPrincipal)
+  ...     id = 'bob'
+  ...     title = description = ''
+  >>> bob = Bob()
+  >>> IUnauthenticatedPrincipal.providedBy(bob)
+  False
+  >>> request.setPrincipal(bob)
+
+In this case, the default behavior is to return None for the snippet:
+
+  >>> print LoginLogout(None, request)()
+  None
+
+To show a logout prompt, an admin must register a marker adapter that provides
+the interface:
+
+  >>> from zope.authentication.interfaces import ILogoutSupported
+
+This flags to LoginLogout that the site supports logout. There is a 'no-op'
+adapter that can be registered for this:
+
+  >>> from zope.authentication.logout import LogoutSupported
+  >>> from zope.component import provideAdapter
+  >>> provideAdapter(LogoutSupported, (None,), ILogoutSupported)
+
+Now when we use LoginLogout with an unauthenticated principal, we get a logout
+prompt:
+
+  >>> LoginLogout(None, request)()
+  u'<a href="@@logout.html?nextURL=http%3A//127.0.0.1">[Logout]</a>'


Property changes on: zmi.core/trunk/src/zmi/core/security/loginlogout.txt
___________________________________________________________________
Added: svn:eol-style
   + native

Added: zmi.core/trunk/src/zmi/core/security/logout.pt
===================================================================
--- zmi.core/trunk/src/zmi/core/security/logout.pt	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/logout.pt	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,37 @@
+<html metal:use-macro="context/@@standard_macros/page"
+    i18n:domain="zope">
+  <head>
+    <metal:block fill-slot="headers">
+      <script type="text/javascript"><!--
+        // clear HTTP Authentication
+        try {
+          if (window.XMLHttpRequest) {
+            var xmlhttp = new XMLHttpRequest();
+            // Send invalid credentials, then abort
+            xmlhttp.open("GET", "@@", true, "logout", "logout");
+            xmlhttp.send("");
+            xmlhttp.abort();
+          } else if (document.execCommand) {
+            // IE specific command
+            document.execCommand("ClearAuthenticationCache");
+          }
+        } catch(e) { }
+        //-->
+      </script>
+    </metal:block>
+  </head>
+  <body>
+  <div metal:fill-slot="body">
+  
+     <h1 i18n:translate="">Logout successful!</h1>
+
+     <p style="font-size: 200%" i18n:translate="">
+       You are now logged out.
+     </p>
+
+     <a href="." i18n:translate="">Back to the main page.</a>
+
+  </div>
+  </body>
+
+</html>

Added: zmi.core/trunk/src/zmi/core/security/principalterms.py
===================================================================
--- zmi.core/trunk/src/zmi/core/security/principalterms.py	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/principalterms.py	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2009 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.
+#
+##############################################################################
+"""Backward-compatibility imports for principal terms
+
+$Id: principalterms.py 97943 2009-03-12 00:38:29Z nadako $
+"""
+
+# BBB
+from zope.authentication.principal import PrincipalTerm as Term
+from zope.authentication.principal import PrincipalTerms

Added: zmi.core/trunk/src/zmi/core/security/redirect.pt
===================================================================
--- zmi.core/trunk/src/zmi/core/security/redirect.pt	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/redirect.pt	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,39 @@
+<html metal:use-macro="context/@@standard_macros/page"
+    i18n:domain="zope">
+  <head>
+    <metal:block fill-slot="headers">
+      <meta http-equiv="refresh" content="0;url=./"
+        tal:attributes="content string:0;;url=${view/request/nextURL}" />
+      <script type="text/javascript"><!--
+        // clear HTTP Authentication
+        try {
+          if (window.XMLHttpRequest) {
+            var xmlhttp = new XMLHttpRequest();
+            // Send invalid credentials, then abort
+            xmlhttp.open("GET", "@@", true, "logout", "logout");
+            xmlhttp.send("");
+            xmlhttp.abort();
+          } else if (document.execCommand) {
+            // IE specific command
+            document.execCommand("ClearAuthenticationCache");
+          }
+        } catch(e) { }
+        //-->
+      </script>
+    </metal:block>
+  </head>
+  <body>
+  <div metal:fill-slot="body">
+  
+     <h1 i18n:translate="">You are being redirected!</h1>
+
+     <p style="font-size: 150%">
+       <a tal:attributes="href view/request/nextURL" i18n:translate="">
+         If you see this screen for more than 5 seconds, click here.
+       </a>
+     </p>
+
+  </div>
+  </body>
+
+</html>

Added: zmi.core/trunk/src/zmi/core/security/tests.py
===================================================================
--- zmi.core/trunk/src/zmi/core/security/tests.py	                        (rev 0)
+++ zmi.core/trunk/src/zmi/core/security/tests.py	2009-11-21 08:18:28 UTC (rev 105939)
@@ -0,0 +1,39 @@
+##############################################################################
+#
+# Copyright (c) 2004 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.
+#
+##############################################################################
+"""Security Views Tests
+
+$Id: tests.py 97977 2009-03-12 10:12:55Z nadako $
+"""
+__docformat__ = "reStructuredText"
+import unittest
+from zope.testing import doctest
+
+def test_bbb_imports():
+    """
+      >>> import zmi.core.security.principalterms as old
+      >>> import zope.authentication.principal as new
+      
+      >>> old.PrincipalTerms is new.PrincipalTerms
+      True
+      >>> old.Term is new.PrincipalTerm
+      True
+    
+    """
+
+def test_suite():
+    return unittest.TestSuite((
+        doctest.DocTestSuite(),
+        doctest.DocFileSuite('authutilitysearchview.txt'),
+        doctest.DocFileSuite('loginlogout.txt'),
+        ))



More information about the checkins mailing list