Skip to content

Commit

Permalink
[fc] Repository: plone.testing
Browse files Browse the repository at this point in the history
Branch: refs/heads/4.3.x
Date: 2019-03-27T08:32:08+01:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: plone/plone.testing@7a6a4c9

set default ZPublisher encoding to utf-8

Files changed:
M CHANGES.rst
M src/plone/testing/z2.py
M src/plone/testing/z2.rst
Repository: plone.testing

Branch: refs/heads/4.3.x
Date: 2019-03-27T09:16:47+01:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/plone.testing@b90ad2f

Merge pull request #63 from plone/issue_62

set default ZPublisher encoding to utf-8

Files changed:
M CHANGES.rst
M src/plone/testing/z2.py
M src/plone/testing/z2.rst
  • Loading branch information
mauritsvanrees committed Mar 27, 2019
1 parent 326d4d1 commit 65d6d03
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
Repository: plone.app.customerize
Repository: plone.testing


Branch: refs/heads/master
Date: 2019-03-26T19:45:31+01:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: https://github.com/plone/plone.app.customerize/commit/652d45d87634a235f309505780c812b89bc6ac00

Fixed: doctests on Python 2 were not correctly checked.
Branch: refs/heads/4.3.x
Date: 2019-03-27T08:32:08+01:00
Author: Peter Mathis (petschki) <[email protected]>
Commit: https://github.com/plone/plone.testing/commit/7a6a4c97426aff6e94d51fe9a1c7a55b592b1a99

Fixes https://github.com/plone/plone.app.customerize/issues/18
set default ZPublisher encoding to utf-8

Files changed:
A news/18.bugfix
M plone/app/customerize/tests/testDocTests.py
M CHANGES.rst
M src/plone/testing/z2.py
M src/plone/testing/z2.rst

b'diff --git a/news/18.bugfix b/news/18.bugfix\nnew file mode 100644\nindex 0000000..df128e1\n--- /dev/null\n+++ b/news/18.bugfix\n@@ -0,0 +1 @@\n+Fixed: doctests on Python 2 were not correctly checked. [maurits]\ndiff --git a/plone/app/customerize/tests/testDocTests.py b/plone/app/customerize/tests/testDocTests.py\nindex 3e18c65..dd92675 100644\n--- a/plone/app/customerize/tests/testDocTests.py\n+++ b/plone/app/customerize/tests/testDocTests.py\n@@ -13,8 +13,8 @@\n class Py23DocChecker(doctest.OutputChecker):\n def check_output(self, want, got, optionflags):\n if six.PY2:\n- got = re.sub(\'zExceptions.NotFound\', \'NotFound\', got)\n- got = re.sub("u\'(.*?)\'", "\'\\\\1\'", want)\n+ got = re.sub(\'NotFound\', \'zExceptions.NotFound\', got)\n+ got = re.sub("u\'(.*?)\'", "\'\\\\1\'", got)\n return doctest.OutputChecker.check_output(self, want, got, optionflags)\n \n \n'
b"diff --git a/CHANGES.rst b/CHANGES.rst\nindex 841efbf..6c84372 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -14,7 +14,8 @@ New features:\n \n Bug fixes:\n \n-- *add item here*\n+- Set default ZPublisher encoding to utf-8 to avoid encoding errors in testbrowser\n+ [petschki]\n \n \n 4.3.2 (2018-10-05)\ndiff --git a/src/plone/testing/z2.py b/src/plone/testing/z2.py\nindex 6f7d916..fc86f30 100644\n--- a/src/plone/testing/z2.py\n+++ b/src/plone/testing/z2.py\n@@ -622,6 +622,11 @@ def setUpApp(self):\n del config.testinghome\n App.config.setConfiguration(config)\n \n+ # set the default ZPublisher encoding to utf-8\n+ # so data without encoding header is handled correctly...\n+ from Zope2.Startup.datatypes import default_zpublisher_encoding\n+ default_zpublisher_encoding('utf-8')\n+\n # This uses the DB from the dbtab, as configured in setUpDatabase().\n # That DB then gets stored as Zope2.DB and becomes the default.\n \ndiff --git a/src/plone/testing/z2.rst b/src/plone/testing/z2.rst\nindex f0fb4ac..5b0cc68 100644\n--- a/src/plone/testing/z2.rst\n+++ b/src/plone/testing/z2.rst\n@@ -383,6 +383,11 @@ We can now view this via the test browser:::\n >>> 'folder1' in browser.contents\n True\n \n+Check if the default ZPublisher encoding is set to utf-8\n+\n+ >>> browser.headers['content-type']\n+ 'text/plain; charset=utf-8'\n+\n The test browser integration converts the URL into a request and passes control to Zope's publisher.\n Let's check that query strings are available for input processing:::\n \n"

Repository: plone.app.customerize
Repository: plone.testing


Branch: refs/heads/master
Date: 2019-03-27T01:02:41+01:00
Author: Gil Forcada Codinachs (gforcada) <[email protected]>
Commit: https://github.com/plone/plone.app.customerize/commit/2901c83ec1e3efe298cb16eb5025618096d22895
Branch: refs/heads/4.3.x
Date: 2019-03-27T09:16:47+01:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: https://github.com/plone/plone.testing/commit/b90ad2fabc13b9bd08156fca992127ad3ebbc2d5

Merge pull request #19 from plone/maurits-issue-18-py23docchecker
Merge pull request #63 from plone/issue_62

Fixed: doctests on Python 2 were not correctly checked.
set default ZPublisher encoding to utf-8

Files changed:
A news/18.bugfix
M plone/app/customerize/tests/testDocTests.py
M CHANGES.rst
M src/plone/testing/z2.py
M src/plone/testing/z2.rst

b'diff --git a/news/18.bugfix b/news/18.bugfix\nnew file mode 100644\nindex 0000000..df128e1\n--- /dev/null\n+++ b/news/18.bugfix\n@@ -0,0 +1 @@\n+Fixed: doctests on Python 2 were not correctly checked. [maurits]\ndiff --git a/plone/app/customerize/tests/testDocTests.py b/plone/app/customerize/tests/testDocTests.py\nindex 3e18c65..dd92675 100644\n--- a/plone/app/customerize/tests/testDocTests.py\n+++ b/plone/app/customerize/tests/testDocTests.py\n@@ -13,8 +13,8 @@\n class Py23DocChecker(doctest.OutputChecker):\n def check_output(self, want, got, optionflags):\n if six.PY2:\n- got = re.sub(\'zExceptions.NotFound\', \'NotFound\', got)\n- got = re.sub("u\'(.*?)\'", "\'\\\\1\'", want)\n+ got = re.sub(\'NotFound\', \'zExceptions.NotFound\', got)\n+ got = re.sub("u\'(.*?)\'", "\'\\\\1\'", got)\n return doctest.OutputChecker.check_output(self, want, got, optionflags)\n \n \n'
b"diff --git a/CHANGES.rst b/CHANGES.rst\nindex 841efbf..6c84372 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -14,7 +14,8 @@ New features:\n \n Bug fixes:\n \n-- *add item here*\n+- Set default ZPublisher encoding to utf-8 to avoid encoding errors in testbrowser\n+ [petschki]\n \n \n 4.3.2 (2018-10-05)\ndiff --git a/src/plone/testing/z2.py b/src/plone/testing/z2.py\nindex 6f7d916..fc86f30 100644\n--- a/src/plone/testing/z2.py\n+++ b/src/plone/testing/z2.py\n@@ -622,6 +622,11 @@ def setUpApp(self):\n del config.testinghome\n App.config.setConfiguration(config)\n \n+ # set the default ZPublisher encoding to utf-8\n+ # so data without encoding header is handled correctly...\n+ from Zope2.Startup.datatypes import default_zpublisher_encoding\n+ default_zpublisher_encoding('utf-8')\n+\n # This uses the DB from the dbtab, as configured in setUpDatabase().\n # That DB then gets stored as Zope2.DB and becomes the default.\n \ndiff --git a/src/plone/testing/z2.rst b/src/plone/testing/z2.rst\nindex f0fb4ac..5b0cc68 100644\n--- a/src/plone/testing/z2.rst\n+++ b/src/plone/testing/z2.rst\n@@ -383,6 +383,11 @@ We can now view this via the test browser:::\n >>> 'folder1' in browser.contents\n True\n \n+Check if the default ZPublisher encoding is set to utf-8\n+\n+ >>> browser.headers['content-type']\n+ 'text/plain; charset=utf-8'\n+\n The test browser integration converts the URL into a request and passes control to Zope's publisher.\n Let's check that query strings are available for input processing:::\n \n"

0 comments on commit 65d6d03

Please sign in to comment.