Commit 794fb635 authored by Jérome Perrin's avatar Jérome Perrin

ui_test: explicitly set response content-type in helper HTML scripts

parent 2fee6617
container.REQUEST.RESPONSE.setHeader('Content-Type', 'text/html')
print "<html><body><h1 class='test-script-title'>Title is : " + parameter + "</h1></body></html>" print "<html><body><h1 class='test-script-title'>Title is : " + parameter + "</h1></body></html>"
return printed return printed
...@@ -18,6 +18,7 @@ def format_date(date): ...@@ -18,6 +18,7 @@ def format_date(date):
creation_date = format_date(context.getCreationDate()) creation_date = format_date(context.getCreationDate())
modification_date = format_date(context.getModificationDate()) modification_date = format_date(context.getModificationDate())
owner = context.Base_getOwnerTitle() owner = context.Base_getOwnerTitle()
container.REQUEST.RESPONSE.setHeader('Content-Type', 'text/html')
return """ return """
<html> <html>
<body> <body>
......
...@@ -16,6 +16,7 @@ checked_uids_objs.sort(key=lambda x:x.getId()) ...@@ -16,6 +16,7 @@ checked_uids_objs.sort(key=lambda x:x.getId())
# we produce html for easier Selenium parsing # we produce html for easier Selenium parsing
table = "\n".join(["<tr><td>%s</td><td>%s</td></tr>" % ( table = "\n".join(["<tr><td>%s</td><td>%s</td></tr>" % (
x.getUid(), x.getId()) for x in checked_uids_objs]) x.getUid(), x.getId()) for x in checked_uids_objs])
container.REQUEST.RESPONSE.setHeader('Content-Type', 'text/html')
return """<html> return """<html>
<head><title>len(checked_uids) == %d</title></head> <head><title>len(checked_uids) == %d</title></head>
<body> <body>
......
...@@ -42,4 +42,5 @@ if not error_list: ...@@ -42,4 +42,5 @@ if not error_list:
if error_list: if error_list:
result = ''.join(error_list) result = ''.join(error_list)
container.REQUEST.RESPONSE.setHeader('Content-Type', 'text/html')
return '<html><body><span id="result">%s</span></body></html>' % result return '<html><body><span id="result">%s</span></body></html>' % result
...@@ -35,4 +35,5 @@ if not error_list: ...@@ -35,4 +35,5 @@ if not error_list:
if error_list: if error_list:
result = ''.join(error_list) result = ''.join(error_list)
container.REQUEST.RESPONSE.setHeader('Content-Type', 'text/html')
return '<html><body><span id="result">%s</span></body></html>' % result return '<html><body><span id="result">%s</span></body></html>' % result
...@@ -33,4 +33,5 @@ if not error_list: ...@@ -33,4 +33,5 @@ if not error_list:
if error_list: if error_list:
result = ''.join(error_list) result = ''.join(error_list)
container.REQUEST.RESPONSE.setHeader('Content-Type', 'text/html')
return '<html><body><span id="result">%s</span></body></html>' % result return '<html><body><span id="result">%s</span></body></html>' % result
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment