[Checkins] SVN: z3ext.preferences/tags/1.4.9/ release tag

Nikolay Kim fafhrd91 at gmail.com
Sun Jul 5 04:00:05 EDT 2009


Log message for revision 101563:
  release tag

Changed:
  A   z3ext.preferences/tags/1.4.9/
  D   z3ext.preferences/tags/1.4.9/CHANGES.txt
  A   z3ext.preferences/tags/1.4.9/CHANGES.txt
  D   z3ext.preferences/tags/1.4.9/setup.py
  A   z3ext.preferences/tags/1.4.9/setup.py
  D   z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/ftesting.zcml
  A   z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/ftesting.zcml
  D   z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/testbrowser.txt
  A   z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/testbrowser.txt
  D   z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/tests.py
  A   z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/tests.py

-=-
Deleted: z3ext.preferences/tags/1.4.9/CHANGES.txt
===================================================================
--- z3ext.preferences/trunk/CHANGES.txt	2009-07-05 02:47:34 UTC (rev 101558)
+++ z3ext.preferences/tags/1.4.9/CHANGES.txt	2009-07-05 08:00:05 UTC (rev 101563)
@@ -1,150 +0,0 @@
-=======
-CHANGES
-=======
-
-1.4.8 (2009-06-22)
-------------------
-
-- Added 'membership' preference category
-
-
-1.4.7 (2009-04-23)
-------------------
-
-- Do not use z3c.autoinclude
-
-- Update styles
-
-
-1.4.6 (2009-03-17)
-------------------
-
-- Fixed preference index view
-
-
-1.4.5 (2009-01-09)
-------------------
-
-- Added 'accesspremission' attribute for preferenceGroup directive
-
-- Fixed security for preference group
-
-
-1.4.4 (2008-12-22)
-------------------
-
-- Use new pagelet api
-
-
-1.4.3 (2008-12-12)
-------------------
-
-- Simplify preferences navigation
-
-- raise Unauthorized exception if unauthenticated user access preferences panel
-
-
-1.4.2 (2008-10-27)
-------------------
-
-- Show preference category if it has editable fields
-
-
-1.4.1 (2008-10-22)
-------------------
-
-- Added translations: ru, nl
-
-
-1.4.0 (2008-10-15)
-------------------
-
-- UI api refactored
-
-- Added default css styles
-
-
-1.3.2 (2008-05-16)
-------------------
-
-- Replace 'autoinclude' with 'includeDependendcies'
-
-
-1.3.1 (2008-05-07)
-------------------
-
-- Fix category rendering
-
-
-1.3.0 (2008-05-06)
-------------------
-
-- UI refactoring
-
-- Do not include permission checker for zope.Public permission
-
-
-1.2.1 (2008-04-22)
-------------------
-
-- Added permission checker to directive
-
-
-1.2.0 (2008-04-18)
-------------------
-
-- 'schema' field for z3ext:preferenceGroup is required now
-
-- Added adapter for IPrincipal to 'schema' with automatic binding
-
-
-1.1.1 (2008-04-15)
-------------------
-
-- Use 'z3ext.ManagePreference' as default preference permission
-
-
-1.1.0 (2008-04-11)
-------------------
-
-- Added 'for' field to z3ext:preferenceGroup directive
-
-
-1.0.2 (2008-04-07)
-------------------
-
-- Fix UI in navigation
-
-
-1.0.1 (2008-04-04)
-------------------
-
-- Fixed group category layout
-
-
-1.0.0 (2008-03-25)
-------------------
-
-- Tests added
-
-- Code moved to svn.zope.org
-
-
-0.9.2 (2008-02-29)
-------------------
-
-- Use z3c.autoinclude
-
-- Added z3c.baseregistry support
-
-
-0.9.1 (2008-02-20)
-------------------
-
-- Use z3ext.layoutform
-
-
-0.9.0 (2008-02-01)
-------------------
-
-- Initial release

Copied: z3ext.preferences/tags/1.4.9/CHANGES.txt (from rev 101560, z3ext.preferences/trunk/CHANGES.txt)
===================================================================
--- z3ext.preferences/tags/1.4.9/CHANGES.txt	                        (rev 0)
+++ z3ext.preferences/tags/1.4.9/CHANGES.txt	2009-07-05 08:00:05 UTC (rev 101563)
@@ -0,0 +1,158 @@
+=======
+CHANGES
+=======
+
+1.4.9 (2009-07-05)
+------------------
+
+- Update tests setup
+
+- Update tests for chameleon enabled setup
+
+
+1.4.8 (2009-06-22)
+------------------
+
+- Added 'membership' preference category
+
+
+1.4.7 (2009-04-23)
+------------------
+
+- Do not use z3c.autoinclude
+
+- Update styles
+
+
+1.4.6 (2009-03-17)
+------------------
+
+- Fixed preference index view
+
+
+1.4.5 (2009-01-09)
+------------------
+
+- Added 'accesspremission' attribute for preferenceGroup directive
+
+- Fixed security for preference group
+
+
+1.4.4 (2008-12-22)
+------------------
+
+- Use new pagelet api
+
+
+1.4.3 (2008-12-12)
+------------------
+
+- Simplify preferences navigation
+
+- raise Unauthorized exception if unauthenticated user access preferences panel
+
+
+1.4.2 (2008-10-27)
+------------------
+
+- Show preference category if it has editable fields
+
+
+1.4.1 (2008-10-22)
+------------------
+
+- Added translations: ru, nl
+
+
+1.4.0 (2008-10-15)
+------------------
+
+- UI api refactored
+
+- Added default css styles
+
+
+1.3.2 (2008-05-16)
+------------------
+
+- Replace 'autoinclude' with 'includeDependendcies'
+
+
+1.3.1 (2008-05-07)
+------------------
+
+- Fix category rendering
+
+
+1.3.0 (2008-05-06)
+------------------
+
+- UI refactoring
+
+- Do not include permission checker for zope.Public permission
+
+
+1.2.1 (2008-04-22)
+------------------
+
+- Added permission checker to directive
+
+
+1.2.0 (2008-04-18)
+------------------
+
+- 'schema' field for z3ext:preferenceGroup is required now
+
+- Added adapter for IPrincipal to 'schema' with automatic binding
+
+
+1.1.1 (2008-04-15)
+------------------
+
+- Use 'z3ext.ManagePreference' as default preference permission
+
+
+1.1.0 (2008-04-11)
+------------------
+
+- Added 'for' field to z3ext:preferenceGroup directive
+
+
+1.0.2 (2008-04-07)
+------------------
+
+- Fix UI in navigation
+
+
+1.0.1 (2008-04-04)
+------------------
+
+- Fixed group category layout
+
+
+1.0.0 (2008-03-25)
+------------------
+
+- Tests added
+
+- Code moved to svn.zope.org
+
+
+0.9.2 (2008-02-29)
+------------------
+
+- Use z3c.autoinclude
+
+- Added z3c.baseregistry support
+
+
+0.9.1 (2008-02-20)
+------------------
+
+- Use z3ext.layoutform
+
+
+0.9.0 (2008-02-01)
+------------------
+
+- Initial release

Deleted: z3ext.preferences/tags/1.4.9/setup.py
===================================================================
--- z3ext.preferences/trunk/setup.py	2009-07-05 02:47:34 UTC (rev 101558)
+++ z3ext.preferences/tags/1.4.9/setup.py	2009-07-05 08:00:05 UTC (rev 101563)
@@ -1,90 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2008 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.
-#
-##############################################################################
-"""Setup for z3ext.preferences package
-
-$Id$
-"""
-import sys, os
-from setuptools import setup, find_packages
-
-def read(*rnames):
-    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-
-version='1.4.9dev'
-
-
-setup(name = 'z3ext.preferences',
-      version = version,
-      author = 'Nikolay Kim',
-      author_email = 'fafhrd91 at gmail.com',
-      description = "z3ext principal preferences",
-      long_description = (
-        'Detailed Documentation\n' +
-        '======================\n'
-        + '\n\n' +
-        read('src', 'z3ext', 'preferences', 'README.txt')
-        + '\n\n' +
-        read('CHANGES.txt')
-        ),
-      classifiers=[
-        'Development Status :: 5 - Production/Stable',
-        'Environment :: Web Environment',
-        'Intended Audience :: Developers',
-        'License :: OSI Approved :: Zope Public License',
-        'Programming Language :: Python',
-        'Natural Language :: English',
-        'Operating System :: OS Independent',
-        'Topic :: Internet :: WWW/HTTP',
-        'Framework :: Zope3'],
-      url='http://z3ext.net/',
-      license='ZPL 2.1',
-      packages=find_packages('src'),
-      package_dir = {'':'src'},
-      namespace_packages=['z3ext'],
-      install_requires = ['setuptools',
-                          'ZODB3',
-                          'zope.component',
-                          'zope.interface',
-                          'zope.annotation',
-                          'zope.publisher',
-                          'zope.configuration',
-                          'zope.schema',
-                          'zope.location',
-                          'zope.security',
-                          'zope.securitypolicy',
-                          'zope.cachedescriptors',
-                          'zope.pagetemplate',
-                          'zope.i18n',
-                          'zope.i18nmessageid',
-                          'zope.viewlet',
-                          'zope.contentprovider',
-                          'zope.app.security',
-                          'zope.app.component',
-                          'zope.app.publisher',
-                          'zope.app.pagetemplate',
-                          'zope.app.principalannotation',
-                          'z3c.traverser',
-                          'z3ext.layout',
-                          'z3ext.layoutform',
-                          'z3ext.statusmessage',
-                          'z3ext.resourcepackage',
-                          ],
-      extras_require = dict(test=['zope.app.testing',
-                                  'zope.testing',
-                                  'zope.testbrowser',
-                                  'zope.app.zcmlfiles',
-                                  ]),
-      include_package_data = True,
-      zip_safe = False
-      )

Copied: z3ext.preferences/tags/1.4.9/setup.py (from rev 101560, z3ext.preferences/trunk/setup.py)
===================================================================
--- z3ext.preferences/tags/1.4.9/setup.py	                        (rev 0)
+++ z3ext.preferences/tags/1.4.9/setup.py	2009-07-05 08:00:05 UTC (rev 101563)
@@ -0,0 +1,91 @@
+##############################################################################
+#
+# Copyright (c) 2008 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.
+#
+##############################################################################
+"""Setup for z3ext.preferences package
+
+$Id$
+"""
+import sys, os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+version='1.4.9'
+
+
+setup(name = 'z3ext.preferences',
+      version = version,
+      author = 'Nikolay Kim',
+      author_email = 'fafhrd91 at gmail.com',
+      description = "z3ext principal preferences",
+      long_description = (
+        'Detailed Documentation\n' +
+        '======================\n'
+        + '\n\n' +
+        read('src', 'z3ext', 'preferences', 'README.txt')
+        + '\n\n' +
+        read('CHANGES.txt')
+        ),
+      classifiers=[
+        'Development Status :: 5 - Production/Stable',
+        'Environment :: Web Environment',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: Zope Public License',
+        'Programming Language :: Python',
+        'Natural Language :: English',
+        'Operating System :: OS Independent',
+        'Topic :: Internet :: WWW/HTTP',
+        'Framework :: Zope3'],
+      url='http://z3ext.net/',
+      license='ZPL 2.1',
+      packages=find_packages('src'),
+      package_dir = {'':'src'},
+      namespace_packages=['z3ext'],
+      install_requires = ['setuptools',
+                          'ZODB3',
+                          'zope.component',
+                          'zope.interface',
+                          'zope.annotation',
+                          'zope.publisher',
+                          'zope.configuration',
+                          'zope.schema',
+                          'zope.location',
+                          'zope.security',
+                          'zope.securitypolicy',
+                          'zope.cachedescriptors',
+                          'zope.pagetemplate',
+                          'zope.i18n',
+                          'zope.i18nmessageid',
+                          'zope.viewlet',
+                          'zope.contentprovider',
+                          'zope.app.security',
+                          'zope.app.component',
+                          'zope.app.publisher',
+                          'zope.app.pagetemplate',
+                          'zope.app.principalannotation',
+                          'z3c.traverser',
+                          'z3ext.layout',
+                          'z3ext.layoutform',
+                          'z3ext.statusmessage',
+                          'z3ext.resourcepackage',
+                          ],
+      extras_require = dict(test=['zope.app.testing',
+                                  'zope.testing',
+                                  'zope.testbrowser',
+                                  'zope.app.zcmlfiles',
+				  'z3ext.autoinclude',
+                                  ]),
+      include_package_data = True,
+      zip_safe = False
+      )

Deleted: z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/ftesting.zcml
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/tests/ftesting.zcml	2009-07-05 02:47:34 UTC (rev 101558)
+++ z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/ftesting.zcml	2009-07-05 08:00:05 UTC (rev 101563)
@@ -1,81 +0,0 @@
-<configure
-   xmlns="http://namespaces.zope.org/zope"
-   xmlns:z3ext="http://namespaces.zope.org/z3ext"
-   xmlns:browser="http://namespaces.zope.org/browser"
-   i18n_domain="zope">
-
-  <!-- This file is the equivalent of site.zcml and it is -->
-  <!-- used for functional testing setup -->
-
-  <include package="zope.component" file="meta.zcml" />
-  <include package="zope.securitypolicy" file="meta.zcml" />
-  <include package="zope.viewlet" file="meta.zcml" />
-  <include package="zope.app.component" file="meta.zcml" />
-  <include package="zope.app.security" file="meta.zcml" />
-  <include package="zope.app.pagetemplate" file="meta.zcml" />
-
-  <include package="zope.securitypolicy" />
-  <include package="zope.contentprovider" />
-  <include package="zope.app.security" />
-  <include package="zope.app.zcmlfiles" />
-  <include package="zope.app.authentication" />
-  <include package="zope.app.zcmlfiles" />
-  <include package="zope.session" />
-
-  <include package="z3c.form" file="meta.zcml" />
-  <include package="z3c.form" />
-  <include package="z3c.traverser" />
-
-  <include package="z3ext.layout" file="meta.zcml" />
-  <include package="z3ext.resource" file="meta.zcml" />
-  <include package="z3ext.resourcepackage" file="meta.zcml" />
-  <include package="z3ext.preferences" file="meta.zcml" />
-  <include package="z3ext.layout" />
-  <include package="z3ext.layoutform" />
-  <include package="z3ext.resource" />
-  <include package="z3ext.resourcepackage" />
-  <include package="z3ext.statusmessage" />
-  <include package="z3ext.preferences" />
-  <include package="z3ext.preferences.tests" />
-  <includeOverrides package="z3ext.preferences.tests" file="overrides.zcml" />
-
-  <browser:defaultSkin name="DefaultSkin" />
-
-  <securityPolicy
-     component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
-
-  <role id="zope.Anonymous" title="Everybody" />
-  <role id="zope.Manager" title="Site Manager" />
-
-  <!-- Replace the following directive if you don't want public access -->
-  <grant permission="zope.View" role="zope.Anonymous" />
-
-  <!-- Principals -->
-  <unauthenticatedPrincipal
-      id="zope.anybody"
-      title="Unauthenticated User" />
-
-  <!-- Principal that tests generally run as -->
-  <principal
-      id="zope.mgr"
-      title="Manager"
-      login="mgr"
-      password="mgrpw" />
-
-  <principal
-      id="zope.user"
-      title="User"
-      login="user"
-      password="userpw" />
-
-  <principal
-      id="zope.user2"
-      title="User2"
-      login="user2"
-      password="userpw" />
-
-  <grant role="zope.Manager" principal="zope.mgr" />
-
-  <grantAll role="zope.Manager" />
-
-</configure>

Copied: z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/ftesting.zcml (from rev 101560, z3ext.preferences/trunk/src/z3ext/preferences/tests/ftesting.zcml)
===================================================================
--- z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/ftesting.zcml	                        (rev 0)
+++ z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/ftesting.zcml	2009-07-05 08:00:05 UTC (rev 101563)
@@ -0,0 +1,52 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:z3ext="http://namespaces.zope.org/z3ext"
+   xmlns:browser="http://namespaces.zope.org/browser"
+   i18n_domain="zope">
+
+  <include package="z3ext.autoinclude" file="meta.zcml" />
+  <includeAllDependencies package="z3ext.preferences" extras="test" />
+
+  <include package="z3ext.preferences.tests" />
+  <includeOverrides package="z3ext.preferences.tests" file="overrides.zcml" />
+
+ <browser:defaultSkin name="DefaultSkin" />
+
+  <securityPolicy
+     component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <role id="zope.Anonymous" title="Everybody" />
+  <role id="zope.Manager" title="Site Manager" />
+
+  <!-- Replace the following directive if you don't want public access -->
+  <grant permission="zope.View" role="zope.Anonymous" />
+
+  <!-- Principals -->
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User" />
+
+  <!-- Principal that tests generally run as -->
+  <principal
+      id="zope.mgr"
+      title="Manager"
+      login="mgr"
+      password="mgrpw" />
+
+  <principal
+      id="zope.user"
+      title="User"
+      login="user"
+      password="userpw" />
+
+  <principal
+      id="zope.user2"
+      title="User2"
+      login="user2"
+      password="userpw" />
+
+  <grant role="zope.Manager" principal="zope.mgr" />
+
+  <grantAll role="zope.Manager" />
+
+</configure>

Deleted: z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/testbrowser.txt
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/tests/testbrowser.txt	2009-07-05 02:47:34 UTC (rev 101558)
+++ z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/testbrowser.txt	2009-07-05 08:00:05 UTC (rev 101563)
@@ -1,181 +0,0 @@
-====================
-Personal preferences
-====================
-
-  >>> from zope import component, interface, event
-  >>> from zope.app.component.hooks import setSite
-  >>> from zope.security.management import newInteraction, endInteraction
-  >>> from zope.app.security.interfaces import IAuthentication
-  >>> from zope.securitypolicy.interfaces import IPrincipalRoleMap
-  >>> from z3ext.preferences.tests.interfaces import IPrefs1
-
-  >>> root = getRootFolder()
-  >>> setSite(root)
-  >>> auth = component.getUtility(IAuthentication)
-  >>> principal = auth.getPrincipal('zope.user')
-
-  >>> class Participation:
-  ...     interaction = None
-  ...     def __init__(self, principal):
-  ...         self.principal = principal
-
-  >>> newInteraction(Participation(principal))
-
-  >>> prefs = IPrefs1(principal)
-
-  >>> roles = IPrincipalRoleMap(prefs)
-  >>> roles.getPrincipalsForRole('preference.Owner')
-  (('zope.user', PermissionSetting: Allow),)
-  >>> roles.getPrincipalsForRole('content.Owner')
-  ()
-
-  >>> roles.getRolesForPrincipal('zope.user')
-  (('preference.Owner', PermissionSetting: Allow),)
-  >>> roles.getRolesForPrincipal('zope.manager')
-  ()
-
-  >>> roles.getSetting('preference.Owner', 'zope.user')
-  PermissionSetting: Allow
-
-  >>> roles.getSetting('content.Owner', 'zope.manager')
-  PermissionSetting: Unset
-
-  >>> roles.getPrincipalsAndRoles()
-  ()
-
-  >>> from z3ext.preferences.utils import hasEditableFields
-  >>> hasEditableFields(prefs)
-  True
-
-  >>> endInteraction()
-
-Browser
-
-  >>> from zope.testbrowser.testing import Browser
-
-  >>> user = Browser()
-  >>> user.handleErrors = False
-  >>> user.open("http://localhost/preferences/")
-  Traceback (most recent call last):
-  ...
-  Unauthorized: preferences
-
-  >>> user.addHeader("Authorization", "Basic user:userpw")
-
-  >>> user.open("http://localhost/preferences/")
-  >>> print user.contents
-  <html>
-  ...
-  ...<h1 class="z-prefs-title">Personal preferences</h1>
-  <div class="z-page-description">This area allows you to change personal preferences.</div>
-  <div class="z-prefs-content"><div class="z-form">
-  <ul class="z-listing">
-    <li>
-       <div class="z-listing-details">
-          <a href="category/">
-            Category</a>
-          <div> &nbsp;</div>
-          <ul class="z-listing">
-            <li>
-              <div class="z-listing-details">
-                <a href="category/prefs1/">
-                  Preferences 1</a>
-                <div> 
-                  &nbsp;</div>
-              </div>
-            </li>
-            <li>
-              <div class="z-listing-details">
-                <a href="category/prefs2/">
-                  Preferences 2</a>
-                <div> 
-                  &nbsp;</div>
-            </div>
-          </li>
-        </ul>
-        <div class="visualClear"></div>
-      </div>
-    </li>
-    <li>
-      <div class="z-listing-details">
-        <a href="portal/">
-           Portal preferences</a>
-        <div>These are all the preferences related to common portal settings. &nbsp;</div>
-        <div class="visualClear"></div>
-      </div>
-    </li>
-  </ul>
-  <div class="visualClear"></div>
-  ...
-  </html>
-
-  >>> user.open("http://localhost/preferences/category/")
-  >>> print user.contents
-  <html>
-  ...
-  <div class="z-prefs-nav">
-    <div class="z-prefs-nav-item-selected">
-       <div class="z-level1">
-         <a href="http://localhost/preferences/category/" title="">
-           Category
-         </a>
-       </div>
-    </div>
-    <div class="z-prefs-nav-item">
-      <div class="z-level1">
-        <a href="http://localhost/preferences/portal/"
-           title="These are all the preferences related to common portal settings.">
-            Portal preferences
-        </a>
-      </div>
-    </div>
-  </div>
-  ...
-  ...<h1 class="z-prefs-title">Category</h1>
-  <div class="z-page-description"></div>
-  <div class="z-prefs-content"><div class="z-form z-form-edit"><form action="http://localhost/preferences/category/index.html"
-          method="post" enctype="multipart/form-data"
-          name="category" id="category">
-    <h1 class="z-form-label">Category</h1>
-    <div class="z-form-fieldset">
-      <div class="z-form-field">
-      <label for="category-widgets-category" title="">Category</label>
-      <div class="z-form-help"></div>
-      <div><input type="text" id="category-widgets-category"
-           name="category.widgets.category"
-           class="text-widget textline-field" value="" />
-    </div>
-    </div>
-    </div>
-      <div class="z-form-controls">
-      <span>
-        <hr />
-        <input type="submit" id="category-buttons-save"
-           name="category.buttons.save"
-           class="z-form-savebutton button-field" value="Save" />
-      </span>
-    </div>
-    </form>
-  </div>
-  <div class="z-form">
-      <h2><a href="http://localhost/preferences/category/prefs1/">Preferences 1</a></h2>
-      <div class="discreet"></div>
-      <br />
-      <h2><a href="http://localhost/preferences/category/prefs2/">Preferences 2</a></h2>
-      <div class="discreet"></div>
-      <br />
-    </div>
-  </div>
-  ...
-  </html>
-
-  >>> user.getLink('Preferences 1').click()
-  >>> user.getControl('Name').value = 'Nikolay'
-  >>> user.getControl(name="category.prefs1.buttons.save").click()
-  >>> 'Data successfully updated.' in user.contents
-  True
-
-  >>> user.open("http://localhost/preferences/category/unknown/")
-  Traceback (most recent call last):
-  ...
-  NotFound: Object: ... name: u'unknown'

Copied: z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/testbrowser.txt (from rev 101560, z3ext.preferences/trunk/src/z3ext/preferences/tests/testbrowser.txt)
===================================================================
--- z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/testbrowser.txt	                        (rev 0)
+++ z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/testbrowser.txt	2009-07-05 08:00:05 UTC (rev 101563)
@@ -0,0 +1,167 @@
+====================
+Personal preferences
+====================
+
+  >>> from zope import component, interface, event
+  >>> from zope.app.component.hooks import setSite
+  >>> from zope.security.management import newInteraction, endInteraction
+  >>> from zope.app.security.interfaces import IAuthentication
+  >>> from zope.securitypolicy.interfaces import IPrincipalRoleMap
+  >>> from z3ext.preferences.tests.interfaces import IPrefs1
+
+  >>> root = getRootFolder()
+  >>> setSite(root)
+  >>> auth = component.getUtility(IAuthentication)
+  >>> principal = auth.getPrincipal('zope.user')
+
+  >>> class Participation:
+  ...     interaction = None
+  ...     def __init__(self, principal):
+  ...         self.principal = principal
+
+  >>> newInteraction(Participation(principal))
+
+  >>> prefs = IPrefs1(principal)
+
+  >>> roles = IPrincipalRoleMap(prefs)
+  >>> roles.getPrincipalsForRole('preference.Owner')
+  (('zope.user', PermissionSetting: Allow),)
+  >>> roles.getPrincipalsForRole('content.Owner')
+  ()
+
+  >>> roles.getRolesForPrincipal('zope.user')
+  (('preference.Owner', PermissionSetting: Allow),)
+  >>> roles.getRolesForPrincipal('zope.manager')
+  ()
+
+  >>> roles.getSetting('preference.Owner', 'zope.user')
+  PermissionSetting: Allow
+
+  >>> roles.getSetting('content.Owner', 'zope.manager')
+  PermissionSetting: Unset
+
+  >>> roles.getPrincipalsAndRoles()
+  ()
+
+  >>> from z3ext.preferences.utils import hasEditableFields
+  >>> hasEditableFields(prefs)
+  True
+
+  >>> endInteraction()
+
+Browser
+
+  >>> from zope.testbrowser.testing import Browser
+
+  >>> user = Browser()
+  >>> user.handleErrors = False
+  >>> user.open("http://localhost/preferences/")
+  Traceback (most recent call last):
+  ...
+  Unauthorized: preferences
+
+  >>> user.addHeader("Authorization", "Basic user:userpw")
+
+  >>> user.open("http://localhost/preferences/")
+  >>> print user.contents
+  <html>
+  ...
+  ...<h1 class="z-prefs-title">Personal preferences</h1><div class="z-page-description">This area allows you to change personal preferences.</div><div class="z-prefs-content"><div class="z-form">
+  <ul class="z-listing">
+    <li>
+       <div class="z-listing-details">
+          <a href="category/">
+            Category</a>
+          <div> &nbsp;</div>
+          <ul class="z-listing">
+            <li>
+              <div class="z-listing-details">
+                <a href="category/prefs1/">
+                  Preferences 1</a>
+                <div> 
+                  &nbsp;</div>
+              </div>
+            </li>
+            <li>
+              <div class="z-listing-details">
+                <a href="category/prefs2/">
+                  Preferences 2</a>
+                <div> 
+                  &nbsp;</div>
+            </div>
+          </li>
+        </ul>
+        <div class="visualClear"></div>
+      </div>
+    </li>
+    <li>
+      <div class="z-listing-details">
+        <a href="portal/">
+           Portal preferences</a>
+        <div>These are all the preferences related to common portal settings. &nbsp;</div>
+        <div class="visualClear"></div>
+      </div>
+    </li>
+  </ul>
+  <div class="visualClear"></div>
+  ...
+  </html>
+
+  >>> user.open("http://localhost/preferences/category/")
+  >>> print user.contents
+  <html>
+  ...
+  <div class="z-prefs-nav">
+    <div class="z-prefs-nav-item-selected">
+       <div class="z-level1">
+         <a href="http://localhost/preferences/category/" title="">
+           Category
+         </a>
+       </div>
+    </div>
+    <div class="z-prefs-nav-item">
+      <div class="z-level1">
+        <a href="http://localhost/preferences/portal/"
+           title="These are all the preferences related to common portal settings.">
+            Portal preferences
+        </a>
+      </div>
+    </div>
+  </div>
+  ...
+  ...<h1 class="z-prefs-title">Category</h1><div class="z-page-description"></div><div class="z-prefs-content"><div class="z-form z-form-edit"><form action="http://localhost/preferences/category/index.html" method="post" enctype="multipart/form-data" name="category" id="category">
+    <h1 class="z-form-label">Category</h1><div class="z-form-fieldset">
+      <div class="z-form-field">
+      <label for="category-widgets-category" title="">Category</label>
+      <div class="z-form-help"></div>
+      <div><input type="text" id="category-widgets-category"
+           name="category.widgets.category"
+           class="text-widget textline-field" value="" />
+      </div>
+    </div>
+    </div>
+      <div class="z-form-controls">
+      <span>
+        <hr />
+        <input type="submit" id="category-buttons-save"
+           name="category.buttons.save"
+           class="z-form-savebutton button-field" value="Save" />
+      </span>
+    </div>
+    </form></div><div class="z-form">
+      <h2><a href="http://localhost/preferences/category/prefs1/">Preferences 1</a></h2><div class="discreet"></div><br />
+      <h2><a href="http://localhost/preferences/category/prefs2/">Preferences 2</a></h2><div class="discreet"></div><br />
+    </div></div></div>
+  ...
+  </html>
+
+  >>> user.getLink('Preferences 1').click()
+  >>> user.getControl('Name').value = 'Nikolay'
+  >>> user.getControl(name="category.prefs1.buttons.save").click()
+  >>> 'Data successfully updated.' in user.contents
+  True
+
+  >>> user.open("http://localhost/preferences/category/unknown/")
+  Traceback (most recent call last):
+  ...
+  NotFound: Object: ... name: u'unknown'

Deleted: z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/tests.py
===================================================================
--- z3ext.preferences/trunk/src/z3ext/preferences/tests/tests.py	2009-07-05 02:47:34 UTC (rev 101558)
+++ z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/tests.py	2009-07-05 08:00:05 UTC (rev 101563)
@@ -1,103 +0,0 @@
-##############################################################################
-#
-# 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.
-#
-##############################################################################
-"""Tests for the Preferences System
-
-$Id$
-"""
-import os.path, unittest, doctest
-
-from zope.component import testing
-from zope.testing import doctestunit
-from zope.app.testing import setup, functional
-
-from zope.app.rotterdam import Rotterdam
-from zope.app.principalannotation import PrincipalAnnotationUtility
-from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility
-from z3ext.layoutform.interfaces import ILayoutFormLayer
-
-
-class IDefaultSkin(ILayoutFormLayer, Rotterdam):
-    """ skin """
-
-
-z3extPreferences = functional.ZCMLLayer(
-    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
-    __name__, 'z3extPreferences', allow_teardown=True)
-
-
-def FunctionalDocFileSuite(*paths, **kw):
-    globs = kw.setdefault('globs', {})
-    globs['sync'] = functional.sync
-    globs['http'] = functional.HTTPCaller()
-    globs['getRootFolder'] = functional.getRootFolder
-
-    kw['package'] = doctest._normalize_module(kw.get('package'))
-
-    kwsetUp = kw.get('setUp')
-    def setUp(test):
-        functional.FunctionalTestSetup().setUp()
-
-        root = functional.getRootFolder()
-        root['principalannotation'] = PrincipalAnnotationUtility()
-        root.getSiteManager().registerUtility(
-            root['principalannotation'], IPrincipalAnnotationUtility)
-
-    kw['setUp'] = setUp
-
-    kwtearDown = kw.get('tearDown')
-    def tearDown(test):
-        functional.FunctionalTestSetup().tearDown()
-
-    kw['tearDown'] = tearDown
-
-    if 'optionflags' not in kw:
-        old = doctest.set_unittest_reportflags(0)
-        doctest.set_unittest_reportflags(old)
-        kw['optionflags'] = (old
-                             | doctest.ELLIPSIS
-                             | doctest.NORMALIZE_WHITESPACE)
-
-    suite = doctest.DocFileSuite(*paths, **kw)
-    suite.layer = z3extPreferences
-    return suite
-
-
-def setUp(test):
-    testing.setUp(test)
-    setup.setUpTestAsModule(test, 'z3ext.preferences.README')
-
-def tearDown(test):
-    testing.tearDown(test)
-    setup.tearDownTestAsModule(test)
-
-def notAvailable(*args):
-    return None
-
-def test_suite():
-    testbrowser = FunctionalDocFileSuite("testbrowser.txt")
-
-    return unittest.TestSuite((
-            testbrowser,
-            doctest.DocFileSuite(
-                '../README.txt',
-                setUp=setUp, tearDown=tearDown,
-                globs={'pprint': doctestunit.pprint},
-                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
-            doctest.DocTestSuite(
-                'z3ext.preferences.utils',
-                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
-            doctest.DocTestSuite(
-                'z3ext.preferences.preferencetype',
-                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
-            ))

Copied: z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/tests.py (from rev 101560, z3ext.preferences/trunk/src/z3ext/preferences/tests/tests.py)
===================================================================
--- z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/tests.py	                        (rev 0)
+++ z3ext.preferences/tags/1.4.9/src/z3ext/preferences/tests/tests.py	2009-07-05 08:00:05 UTC (rev 101563)
@@ -0,0 +1,104 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""Tests for the Preferences System
+
+$Id$
+"""
+import os.path, unittest, doctest
+
+from zope import component
+from zope.component import testing
+from zope.testing import doctestunit
+from zope.app.testing import setup, functional
+
+from zope.app.rotterdam import Rotterdam
+from zope.app.principalannotation import PrincipalAnnotationUtility
+from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility
+from z3ext.layoutform.interfaces import ILayoutFormLayer
+
+
+class IDefaultSkin(ILayoutFormLayer, Rotterdam):
+    """ skin """
+
+
+z3extPreferences = functional.ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'z3extPreferences', allow_teardown=True)
+
+
+def FunctionalDocFileSuite(*paths, **kw):
+    globs = kw.setdefault('globs', {})
+    globs['sync'] = functional.sync
+    globs['http'] = functional.HTTPCaller()
+    globs['getRootFolder'] = functional.getRootFolder
+
+    kw['package'] = doctest._normalize_module(kw.get('package'))
+
+    kwsetUp = kw.get('setUp')
+    def setUp(test):
+        functional.FunctionalTestSetup().setUp()
+
+        root = functional.getRootFolder()
+        root['principalannotation'] = PrincipalAnnotationUtility()
+        root.getSiteManager().registerUtility(
+            root['principalannotation'], IPrincipalAnnotationUtility)
+
+    kw['setUp'] = setUp
+
+    kwtearDown = kw.get('tearDown')
+    def tearDown(test):
+        functional.FunctionalTestSetup().tearDown()
+
+    kw['tearDown'] = tearDown
+
+    if 'optionflags' not in kw:
+        old = doctest.set_unittest_reportflags(0)
+        doctest.set_unittest_reportflags(old)
+        kw['optionflags'] = (old
+                             | doctest.ELLIPSIS
+                             | doctest.NORMALIZE_WHITESPACE)
+
+    suite = doctest.DocFileSuite(*paths, **kw)
+    suite.layer = z3extPreferences
+    return suite
+
+
+def setUp(test):
+    testing.setUp(test)
+    setup.setUpTestAsModule(test, 'z3ext.preferences.README')
+
+def tearDown(test):
+    testing.tearDown(test)
+    setup.tearDownTestAsModule(test)
+
+def notAvailable(*args):
+    return None
+
+def test_suite():
+    testbrowser = FunctionalDocFileSuite("testbrowser.txt")
+
+    return unittest.TestSuite((
+            testbrowser,
+            doctest.DocFileSuite(
+                '../README.txt',
+                setUp=setUp, tearDown=tearDown,
+                globs={'pprint': doctestunit.pprint},
+                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
+            doctest.DocTestSuite(
+                'z3ext.preferences.utils',
+                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
+            doctest.DocTestSuite(
+                'z3ext.preferences.preferencetype',
+                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
+            ))



More information about the Checkins mailing list