mardi 18 décembre 2018

How to unit test flask Log in?

Hi i am trying to test my application using unit testing but my code isnt working.

def test_login(self):
    tester = app.test_client(self)
    response = tester.post('/login', data=dict(username="test", 
    password="test"), 
    follow_redirects=True)
    self.assertIn(b'Welcome to Website', response.data)

This gives me an error "self.assertIn(b'Welcome to Website', response.data) not found in b'

Any advice?




Aucun commentaire:

Enregistrer un commentaire