Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Fix test_edit_with_errors to not import a private variable from zope.…
Browse files Browse the repository at this point in the history
…pagetemplate. Fixes test failure with latest zope.pagetemplate.
  • Loading branch information
thet committed Jan 29, 2016
1 parent 6ff3d35 commit 05d57ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Changelog
2.2.4 (unreleased)
~~~~~~~~~~~~~~~~~~

- Nothing changed yet.
- Fix ``test_edit_with_errors`` to not import a private variable from
``zope.pagetemplate``. Fixes test failure with latest zope.pagetemplate.
[thet]


2.2.3 (2015-07-18)
Expand Down
5 changes: 3 additions & 2 deletions src/five/pt/tests/test_persistenttemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,15 @@ def test_filename_attribute(self):
self.assertEqual(template().strip(), u'012')

def test_edit_with_errors(self):
from zope.pagetemplate.pagetemplate import _error_start
template = self._makeOne('foo', simple_error)
# this should not raise:
editable_text = get_editable_content(template)
# and the errors should be in an xml comment at the start of
# the editable text
error_prefix = cgi.escape(
'%s\n %s\n-->\n' % (_error_start, '\n '.join(template._v_errors))
'<!-- Page Template Diagnostics\n {0}\n-->\n'.format(
'\n '.join(template._v_errors)
)
)
self.assertTrue(editable_text.startswith(error_prefix))

Expand Down

0 comments on commit 05d57ea

Please sign in to comment.