diff options
Diffstat (limited to 'tests/regressiontests/forms/util.py')
| -rw-r--r-- | tests/regressiontests/forms/util.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/util.py b/tests/regressiontests/forms/util.py index 68c082c114..845ddeaadb 100644 --- a/tests/regressiontests/forms/util.py +++ b/tests/regressiontests/forms/util.py @@ -49,4 +49,11 @@ u'' # Can take a non-string. >>> print ValidationError(VeryBadError()).messages <ul class="errorlist"><li>A very bad error.</li></ul> + +# Escapes non-safe input but not input marked safe. +>>> example = 'Example of link: <a href="http://www.example.com/">example</a>' +>>> print ValidationError(example).messages +<ul class="errorlist"><li>Example of link: <a href="http://www.example.com/">example</a></li></ul> +>>> print ValidationError(mark_safe(example)).messages +<ul class="errorlist"><li>Example of link: <a href="http://www.example.com/">example</a></li></ul> """ |
