add test helpers to check for text in the HTML output

This commit is contained in:
Andreas Zweili 2019-10-20 21:22:09 +02:00
parent 4b2951a1b4
commit 40ece7cc4f
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
def in_content(response, string):
decoded_content = response.content.decode('utf8')
if string not in decoded_content:
return False
return True
def not_in_content(response, string):
decoded_content = response.content.decode('utf8')
if string in decoded_content:
return False
return True