mirror of
https://github.com/Nebucatnetzer/network_inventory.git
synced 2024-07-02 22:21:01 +02:00
67fa2792d9
When the object_to_find string contained a special character which the django template system escapes then the test filed because the helpers where looking for the unescaped string. Now they escape the string as well.
16 lines
425 B
Python
16 lines
425 B
Python
from django.utils.html import escape
|
|
|
|
|
|
def in_content(response, object_to_find):
|
|
decoded_content = response.content.decode('utf8')
|
|
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(escape(object_to_find)) in decoded_content:
|
|
return False
|
|
return True
|