test_web.py: fix test_GET_DIRECTORY_html_filenode_encoding for Twisted==12.3.0. fixes #1922 #31

Merged
mk-fg merged 1 commits from 1922_fix_test_web_test_GET_DIRECTORY_html_filenode_encoding into master 2013-02-28 04:33:12 +00:00
mk-fg commented 2013-02-27 17:30:53 +00:00 (Migrated from github.com)

twisted.web.html.escape was used to produce html-encoded string (to then look it up in "value" attribute), but behavior of that function has changed between Twisted 12.2.0 (simple custom implementation) and 12.3.0 (imported from stdlib cgi module).
cgi.escape() requires quote=True parameter to escape double-quote characters.

Fixed by simply using reliable cgi.escape to produce html-escaped string for tests.

Pretty sure I used twisted.web.html.escape because Nevow also used it, but looks like currently it properly quotes attribute values, so guess different func is used for attributes there.

twisted.web.html.escape was used to produce html-encoded string (to then look it up in "value" attribute), but behavior of that function has changed between Twisted 12.2.0 (simple custom implementation) and 12.3.0 (imported from stdlib cgi module). cgi.escape() requires quote=True parameter to escape double-quote characters. Fixed by simply using reliable cgi.escape to produce html-escaped string for tests. Pretty sure I used twisted.web.html.escape because Nevow also used it, but looks like currently it properly quotes attribute values, so guess different func is used for attributes there.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/tahoe-lafs#31
No description provided.