I would like to test whether a flash message contains certain text. So I have the line:
response = tester.post('login',
data=dict(
username='test', password='lol'), follow_redirects=True)
assert 'Welcome back!' in response.data
This however fails with the error message:
assert 'Welcome back!' in response.data
TypeError: a bytes-like object is required, not 'str'
Does anyone understand what I am doing wrong?
Aucun commentaire:
Enregistrer un commentaire