def test_login_logout(client):
 rv = register_and_login(client, 'user1', 'default')
 assert ('You were logged in' in rv.data)
 rv = logout(client)
 assert ('You were logged out' in rv.data)
 rv = login(client, 'user1', 'wrongpassword')
 assert ('Invalid password' in rv.data)
 rv = login(client, 'user2', 'wrongpassword')
 assert ('Invalid username' in rv.data)

def test_login_logout ( client ) : rv = register_and_login ( client , 'user1' , 'default' ) assert ( 'You were logged in' in rv . data ) rv = logout ( client ) assert ( 'You were logged out' in rv . data ) rv = login ( client , 'user1' , 'wrongpassword' ) assert ( 'Invalid password' in rv . data ) rv = login ( client , 'user2' , 'wrongpassword' ) assert ( 'Invalid username' in rv . data )
make sure logging in and logging out works .