diff --git a/IPython/html/tests/base/security.js b/IPython/html/tests/base/security.js
index cdcf74b..690172c 100644
--- a/IPython/html/tests/base/security.js
+++ b/IPython/html/tests/base/security.js
@@ -2,7 +2,7 @@ safe_tests = [
"
Hi there
",
'Hi There!
',
'citation',
- 'Hi There
'
+ 'Hi There
',
];
unsafe_tests = [
@@ -25,12 +25,16 @@ casper.notebook_test(function () {
var is_safe = self.evaluate(function (item) {
return IPython.security.is_safe(item);
}, item);
- this.test.assert(is_safe, item);
+ this.test.assert(is_safe, "Safe: " + item);
});
this.each(unsafe_tests, function (self, item) {
var is_safe = self.evaluate(function (item) {
return IPython.security.is_safe(item);
}, item);
- this.test.assert(!is_safe, item);
+ this.test.assert(!is_safe, "Unsafe: " + item);
+ var sanitized = self.evaluate(function (item) {
+ return IPython.security.sanitize_html(item);
+ }, item);
+ this.test.assertEquals(sanitized.indexOf("alert"), -1, "Sanitized " + item);
});
});
\ No newline at end of file