def test_data_appear_on_login(self): tester = dataApp.test_client(self) response = tester.post( '/login', data = dict(userName='******',password='******'), follow_redirects=True) self.assertIn('42', response.data)
def test_login_wrong(self): tester = dataApp.test_client(self) response = tester.post( '/login', data = dict(userName='******',password='******'), follow_redirects=True) self.assertIn('please', response.data)
def test_logout(self): tester = dataApp.test_client(self) tester.post( '/login', data = dict(userName='******',password='******'), follow_redirects=True) response = tester.get('/logout', content_type='html/text') self.assertIn('Thank you for visiting Simple Data', response.data)
def test_data_requires_login(self): tester = dataApp.test_client(self) response = tester.get('/data', follow_redirects=True) self.assertIn('please login to view', response.data)
def test_index(self): tester = dataApp.test_client(self) response = tester.get('/login', content_type='html/text') self.assertEqual(response.status_code,200)
def test_index_with_response(self): tester = dataApp.test_client(self) response = tester.get('/login', content_type='html/text') self.assertTrue('Welcome' in response.data)