Skip to content
This repository has been archived by the owner on Apr 9, 2019. It is now read-only.

Commit

Permalink
Remove zope 2.10 compat code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed May 19, 2012
1 parent 860b3ca commit 2fb3532
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions plone/z3cform/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def setup_defaults():
testing_zcml_layer = ZCMLLayer(
testing_zcml_path, 'plone.z3cform', 'testing_zcml_layer')


def test_suite():
layout_txt = doctest.DocFileSuite('layout.txt')
layout_txt.layer = testing_zcml_layer
Expand All @@ -71,18 +72,8 @@ def test_suite():
fieldsets_txt = doctest.DocFileSuite('fieldsets/README.txt')
fieldsets_txt.layer = testing_zcml_layer

if sys.version_info[:2] > (2, 4):
# Zope 2.10 raises TraversalError instead of LocationError
traversal_txt = doctest.DocFileSuite('traversal.txt')
traversal_txt.layer = testing_zcml_layer
else:
import tempfile
tmp = tempfile.NamedTemporaryFile()
test = open(os.path.join(os.path.dirname(__file__), 'traversal.txt')).read()
tmp.write(test.replace('LocationError', 'TraversalError'))
tmp.flush()
traversal_txt = doctest.DocFileSuite(tmp.name, module_relative=False)
traversal_txt.layer = testing_zcml_layer
traversal_txt = doctest.DocFileSuite('traversal.txt')
traversal_txt.layer = testing_zcml_layer

return unittest.TestSuite([
layout_txt, inputs_txt, fieldsets_txt, traversal_txt,
Expand Down

0 comments on commit 2fb3532

Please sign in to comment.