network_inventory/inventory/tests/helper.py

13 lines
370 B
Python
Raw Normal View History

def in_content(response, object_to_find):
2019-08-11 21:35:21 +02:00
decoded_content = response.content.decode('utf8')
if str(object_to_find) not in decoded_content:
2019-08-11 21:35:21 +02:00
return False
return True
def not_in_content(response, object_to_find):
2019-08-11 21:35:21 +02:00
decoded_content = response.content.decode('utf8')
if str(object_to_find) in decoded_content:
2019-08-11 21:35:21 +02:00
return False
return True