Skip to content

Commit

Permalink
Support unicode values for form controls
Browse files Browse the repository at this point in the history
  • Loading branch information
kedder committed Apr 12, 2013
1 parent 60b0cc3 commit 611c6c3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/zope/testbrowser/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,9 @@ def __init__(self, url=None, wsgi_app=None):
self.handleErrors = True

if wsgi_app is None:
self.testapp = TestbrowserApp(TransparentProxy(),
use_unicode=False)
self.testapp = TestbrowserApp(TransparentProxy())
else:
self.testapp = TestbrowserApp(wsgi_app,
use_unicode=False)
self.testapp = TestbrowserApp(wsgi_app)
self.testapp.restricted = True

self._req_headers = {}
Expand Down Expand Up @@ -654,7 +652,7 @@ def value(self):
return ''

if isinstance(self._control, webtest.forms.Submit):
return str(self._control.value_if_submitted())
return self.browser.toStr(self._control.value_if_submitted())

val = self._control.value
if val is None:
Expand All @@ -663,7 +661,7 @@ def value(self):
if val.startswith('\n'):
val = val[1:]

return str(val)
return self.browser.toStr(val)

@value.setter
def value(self, value):
Expand Down

0 comments on commit 611c6c3

Please sign in to comment.