summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-09-24 12:28:19 -0400
committerChris McDonough <chrism@plope.com>2011-09-24 12:28:19 -0400
commit10d2f293f250faf93844a8446c8fcfc5e1c90580 (patch)
treed099c5800a018524d33f785bfa2579c18cd1c4f1
parentc9b78f324cdbd38c2ac095ea97472605746e081e (diff)
downloadpyramid-10d2f293f250faf93844a8446c8fcfc5e1c90580.tar.gz
pyramid-10d2f293f250faf93844a8446c8fcfc5e1c90580.tar.bz2
pyramid-10d2f293f250faf93844a8446c8fcfc5e1c90580.zip
fix mako tests on py3
-rw-r--r--pyramid/compat.py5
-rw-r--r--pyramid/tests/fixtures/helloworld.mak4
-rw-r--r--pyramid/tests/fixtures/helloworld.mako4
-rw-r--r--pyramid/tests/pkgs/permbugapp/__init__.py4
4 files changed, 11 insertions, 6 deletions
diff --git a/pyramid/compat.py b/pyramid/compat.py
index ed5e900ad..1936d58ac 100644
--- a/pyramid/compat.py
+++ b/pyramid/compat.py
@@ -204,3 +204,8 @@ try:
from Cookie import SimpleCookie
except ImportError: # pragma: no cover
from http.cookies import SimpleCookie
+
+if PY3: # pragma: no cover
+ from html import escape
+else:
+ from cgi import escape
diff --git a/pyramid/tests/fixtures/helloworld.mak b/pyramid/tests/fixtures/helloworld.mak
index efcf791e8..25283a50d 100644
--- a/pyramid/tests/fixtures/helloworld.mak
+++ b/pyramid/tests/fixtures/helloworld.mak
@@ -1,3 +1,3 @@
## -*- coding: utf-8 -*-
-<% a, b = 'foo', u'föö' %>
-Hello ${u'föö'}
+<%!from pyramid.compat import text_%><% a, b = 'foo', text_('föö', 'utf-8') %>
+Hello ${text_('föö', 'utf-8')}
diff --git a/pyramid/tests/fixtures/helloworld.mako b/pyramid/tests/fixtures/helloworld.mako
index efcf791e8..25283a50d 100644
--- a/pyramid/tests/fixtures/helloworld.mako
+++ b/pyramid/tests/fixtures/helloworld.mako
@@ -1,3 +1,3 @@
## -*- coding: utf-8 -*-
-<% a, b = 'foo', u'föö' %>
-Hello ${u'föö'}
+<%!from pyramid.compat import text_%><% a, b = 'foo', text_('föö', 'utf-8') %>
+Hello ${text_('föö', 'utf-8')}
diff --git a/pyramid/tests/pkgs/permbugapp/__init__.py b/pyramid/tests/pkgs/permbugapp/__init__.py
index 10a244f3b..330d983ab 100644
--- a/pyramid/tests/pkgs/permbugapp/__init__.py
+++ b/pyramid/tests/pkgs/permbugapp/__init__.py
@@ -1,6 +1,6 @@
-from cgi import escape
+from pyramid.compat import escape
from pyramid.security import view_execution_permitted
-from webob import Response
+from pyramid.response import Response
def x_view(request): # pragma: no cover
return Response('this is private!')