-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/master Date: 2018-10-04T09:06:44+02:00 Author: Joni Orponen (Rotonen) <joni.orponen@gmail.com> Commit: plone/plone.app.testing@2a5b210 Fix now-false doctests on layer setup port selection. Files changed: M CHANGES.rst M plone/app/testing/layers.rst Repository: plone.app.testing Branch: refs/heads/master Date: 2018-10-04T13:23:49+02:00 Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> Commit: plone/plone.app.testing@b426d40 Merge pull request #52 from plone/roto-fix-layersetup-doctests Fix now-false doctests on layer setup port selection Files changed: M CHANGES.rst M plone/app/testing/layers.rst
- Loading branch information
Showing
1 changed file
with
17 additions
and
21 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 |
---|---|---|
@@ -1,38 +1,34 @@ | ||
Repository: plone.app.content | ||
Repository: plone.app.testing | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-10-02T12:07:01+02:00 | ||
Author: Katja Süss (ksuess) <k.suess@rohberg.ch> | ||
Commit: https://github.com/plone/plone.app.content/commit/868c06b1c1cf6f0b27c8d87db2168e18d4e95545 | ||
Date: 2018-10-04T09:06:44+02:00 | ||
Author: Joni Orponen (Rotonen) <joni.orponen@gmail.com> | ||
Commit: https://github.com/plone/plone.app.testing/commit/2a5b21056c63d4e5b1c149f845835a59cae29c72 | ||
|
||
remove plone_scripts/browserDefault | ||
|
||
https://github.com/plone/Products.CMFPlone/issues/1801 | ||
Fix now-false doctests on layer setup port selection. | ||
|
||
Files changed: | ||
M plone/app/content/browser/reviewlist.py | ||
M plone/app/content/tests/test_reviewlist.py | ||
M CHANGES.rst | ||
M plone/app/testing/layers.rst | ||
|
||
b"diff --git a/plone/app/content/browser/reviewlist.py b/plone/app/content/browser/reviewlist.py\nindex 9419a52..721103d 100644\n--- a/plone/app/content/browser/reviewlist.py\n+++ b/plone/app/content/browser/reviewlist.py\n@@ -58,7 +58,7 @@ def items(self):\n use_view_action = registry.get(\n 'plone.types_use_view_action_in_listings', ())\n \n- browser_default = self.context.browserDefault()\n+ browser_default = plone_utils.browserDefault(self.context)\n \n results = list()\n for i, obj in enumerate(self.context.my_worklist()):\ndiff --git a/plone/app/content/tests/test_reviewlist.py b/plone/app/content/tests/test_reviewlist.py\nindex 6032f1f..8ed5be0 100644\n--- a/plone/app/content/tests/test_reviewlist.py\n+++ b/plone/app/content/tests/test_reviewlist.py\n@@ -49,7 +49,7 @@ def test_unauthenticated(self):\n \n def test_authenticated(self):\n '''\n- unauthenticated users do not have the necessary permissions to view\n+ authenticated users do have the necessary permissions to view\n the review list\n '''\n self.browser.addHeader('Authorization',\n@@ -59,7 +59,7 @@ def test_authenticated(self):\n \n def test_with_content(self):\n '''\n- unauthenticated users do not have the necessary permissions to view\n+ authenticated users do have the necessary permissions to view\n the review list\n '''\n doc = self.createDocument(\n" | ||
b"diff --git a/CHANGES.rst b/CHANGES.rst\nindex f659823..09454d9 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -21,7 +21,8 @@ New features:\n \n Bug fixes:\n \n-- *add item here*\n+- Amended the doctests to work with automatical layer port picking from plone.testing.\n+ [Rotonen]\n \n \n 5.0.8 (2017-10-25)\ndiff --git a/plone/app/testing/layers.rst b/plone/app/testing/layers.rst\nindex 9e65987..713a7dd 100644\n--- a/plone/app/testing/layers.rst\n+++ b/plone/app/testing/layers.rst\n@@ -302,8 +302,7 @@ indicate where Zope is running.\n \n >>> port = layers.PLONE_ZSERVER['port']\n >>> import os\n- >>> port == int(os.environ.get('ZSERVER_PORT', 55001))\n- True\n+ >>> # port == int(os.environ.get('ZSERVER_PORT', 0))\n \n Let's now simulate a test. Test setup does nothing beyond what the base layers\n do.\n@@ -407,8 +406,7 @@ indicate where Zope is running.\n \n >>> port = layers.PLONE_FTP_SERVER['port']\n >>> import os\n- >>> port == int(os.environ.get('FTPSERVER_PORT', 55002))\n- True\n+ >>> # port == int(os.environ.get('FTPSERVER_PORT', 0))\n \n Let's now simulate a test. Test setup does nothing beyond what the base layers\n do.\n" | ||
|
||
Repository: plone.app.content | ||
Repository: plone.app.testing | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-10-03T18:15:07+02:00 | ||
Author: Katja Süss (ksuess) <k.suess@rohberg.ch> | ||
Commit: https://github.com/plone/plone.app.content/commit/c1712e327234b15885356c6e46b9de42bd6bd757 | ||
Date: 2018-10-04T13:23:49+02:00 | ||
Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com> | ||
Commit: https://github.com/plone/plone.app.testing/commit/b426d40dc25ebe50321bf1dde1f70347917b1de6 | ||
|
||
Merge pull request #52 from plone/roto-fix-layersetup-doctests | ||
|
||
Merge branch 'master' of https://github.com/plone/plone.app.content | ||
Fix now-false doctests on layer setup port selection | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M plone/app/content/browser/content_status_history.py | ||
M plone/app/content/browser/file.py | ||
M plone/app/content/browser/reviewlist.py | ||
M plone/app/content/browser/templates/content_status_history.pt | ||
M setup.py | ||
M plone/app/testing/layers.rst | ||
|
||
b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex f5cc852..8384646 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -1,7 +1,7 @@\n Changelog\n =========\n \n-3.5.5 (unreleased)\n+3.6.0 (unreleased)\n ------------------\n \n Breaking changes:\n@@ -10,11 +10,16 @@ Breaking changes:\n \n New features:\n \n-- *add item here*\n+- Use obj.get_size() instead of getObjSize skin script.\n+ Allows removing the script and also returns a numerical value.\n+ #1801\n+ [reinhardt]\n \n Bug fixes:\n \n - *add item here*\n+- Added get_objects_from_path_list to replace skin script. #1801\n+ [reinhardt]\n \n \n 3.5.4 (2018-09-23)\ndiff --git a/plone/app/content/browser/content_status_history.py b/plone/app/content/browser/content_status_history.py\nindex 2dce48b..efa382d 100644\n--- a/plone/app/content/browser/content_status_history.py\n+++ b/plone/app/content/browser/content_status_history.py\n@@ -119,3 +119,12 @@ def validate(self, workflow_action=None, paths=[]):\n # Set paths using orgi_paths, otherwise users are getting confused\n orig_paths = self.request.get(\'orig_paths\')\n self.request.set(\'paths\', orig_paths)\n+\n+ def get_objects_from_path_list(self, paths=[]):\n+ contents = []\n+ portal = getToolByName(self.context, \'portal_url\').getPortalObject()\n+ for path in paths:\n+ obj = portal.restrictedTraverse(str(path), None)\n+ if obj is not None:\n+ contents.append(obj)\n+ return contents\ndiff --git a/plone/app/content/browser/file.py b/plone/app/content/browser/file.py\nindex 6fce2c6..105bcbb 100644\n--- a/plone/app/content/browser/file.py\n+++ b/plone/app/content/browser/file.py\n@@ -180,7 +180,7 @@ def __call__(self):\n try:\n result[\'size\'] = obj.getSize()\n except AttributeError:\n- result[\'size\'] = obj.getObjSize()\n+ result[\'size\'] = obj.get_size()\n \n if tusrequest:\n tus.cleanup_file()\ndiff --git a/plone/app/content/browser/reviewlist.py b/plone/app/content/browser/reviewlist.py\nindex 721103d..84db314 100644\n--- a/plone/app/content/browser/reviewlist.py\n+++ b/plone/app/content/browser/reviewlist.py\n@@ -5,6 +5,7 @@\n from plone.registry.interfaces import IRegistry\n from Products.CMFCore.utils import getToolByName\n from Products.CMFPlone.utils import safe_unicode\n+from Products.CMFPlone.utils import human_readable_size\n from six.moves import map\n from six.moves.urllib.parse import quote_plus\n from zope.component import getMultiAdapter\n@@ -114,7 +115,7 @@ def items(self):\n title_or_id=obj.pretty_title_or_id(),\n description=obj.Description(),\n obj_type=obj.Type,\n- size=obj.getObjSize(),\n+ size=human_readable_size(obj.get_size()),\n modified=modified,\n type_class=type_class,\n wf_state=review_state,\ndiff --git a/plone/app/content/browser/templates/content_status_history.pt b/plone/app/content/browser/templates/content_status_history.pt\nindex 737b048..eb2cffc 100644\n--- a/plone/app/content/browser/templates/content_status_history.pt\n+++ b/plone/app/content/browser/templates/content_status_history.pt\n@@ -39,7 +39,7 @@\n tal:define="errors view/errors;\n review_state context_state/workflow_state;\n paths python:request.get(\'paths\', [\'/\'.join(context.getPhysicalPath())]);\n- batch python:context.getObjectsFromPathList(paths, batch=False);\n+ batch python:view.get_objects_from_path_list(paths);\n folders_in_publishing python:[o.getId for o in batch if o.isPrincipiaFolderish];\n came_from python:request.get(\'HTTP_REFERER\', context.absolute_url()).split(\'?\')[0];\n dummy python:request.set(\'orig_template\', came_from);\ndiff --git a/setup.py b/setup.py\nindex d9eeb1a..f9ba034 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -2,7 +2,7 @@\n from setuptools import find_packages\n from setuptools import setup\n \n-version = \'3.5.5.dev0\'\n+version = \'3.6.0.dev0\'\n \n setup(\n name=\'plone.app.content\',\n@@ -14,7 +14,6 @@\n ]),\n classifiers=[\n "Framework :: Plone",\n- "Framework :: Plone :: 5.1",\n "Framework :: Plone :: 5.2",\n "License :: OSI Approved :: GNU General Public License v2 (GPLv2)",\n "Programming Language :: Python",\n' | ||
b"diff --git a/CHANGES.rst b/CHANGES.rst\nindex f659823..09454d9 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -21,7 +21,8 @@ New features:\n \n Bug fixes:\n \n-- *add item here*\n+- Amended the doctests to work with automatical layer port picking from plone.testing.\n+ [Rotonen]\n \n \n 5.0.8 (2017-10-25)\ndiff --git a/plone/app/testing/layers.rst b/plone/app/testing/layers.rst\nindex 9e65987..713a7dd 100644\n--- a/plone/app/testing/layers.rst\n+++ b/plone/app/testing/layers.rst\n@@ -302,8 +302,7 @@ indicate where Zope is running.\n \n >>> port = layers.PLONE_ZSERVER['port']\n >>> import os\n- >>> port == int(os.environ.get('ZSERVER_PORT', 55001))\n- True\n+ >>> # port == int(os.environ.get('ZSERVER_PORT', 0))\n \n Let's now simulate a test. Test setup does nothing beyond what the base layers\n do.\n@@ -407,8 +406,7 @@ indicate where Zope is running.\n \n >>> port = layers.PLONE_FTP_SERVER['port']\n >>> import os\n- >>> port == int(os.environ.get('FTPSERVER_PORT', 55002))\n- True\n+ >>> # port == int(os.environ.get('FTPSERVER_PORT', 0))\n \n Let's now simulate a test. Test setup does nothing beyond what the base layers\n do.\n" | ||
|