diff --git a/core/tests/helper.py b/core/tests/helper.py index d27e108..27a1065 100644 --- a/core/tests/helper.py +++ b/core/tests/helper.py @@ -1,12 +1,15 @@ +from django.utils.html import escape + + def in_content(response, object_to_find): decoded_content = response.content.decode('utf8') - if str(object_to_find) not in decoded_content: + if str(escape(object_to_find)) not in decoded_content: return False return True def not_in_content(response, object_to_find): decoded_content = response.content.decode('utf8') - if str(object_to_find) in decoded_content: + if str(escape(object_to_find)) in decoded_content: return False return True