def test_logout(self): tester = app.test_client(self) tester.post('/login/', data=dict(username="******", password="******"), follow_redirects=True) response = tester.get('/logout/', follow_redirects=True) self.assertIn(b'You are logged out.', response.data)
def test_delete_expense_page_loads(self): tester = app.test_client(self) tester.post('/login/', data=dict(username="******", password="******"), follow_redirects=True) response = tester.get('/user/1/3/delete', follow_redirects=True) self.assertIn(b'Delete an expense', response.data)
def test_incorrect_login(self): tester = app.test_client(self) response = tester.post('/login/', data=dict(username="******", password="******"), follow_redirects=True) self.assertIn(b'login', response.data)
def test_incorrect_login(self): tester = app.test_client(self) response = tester.post('/login/', data=dict(username="******", password="******"), follow_redirects=True) self.assertIn(b'Username does not exist.', response.data)
def test_logged_in_homepage(self): tester = app.test_client(self) response = tester.post('/login/', data=dict(username="******", password="******"), follow_redirects=True) self.assertIn(b'Price', response.data) self.assertIn(b'Date', response.data) self.assertIn(b'Description', response.data) self.assertIn(b'Action', response.data)
def test_index(self): tester = app.test_client(self) response = tester.get('/', content_type='html/text') self.assertEqual(response.status_code, 200)
def test_register_page_loads(self): tester = app.test_client(self) response = tester.get('/register', content_type='html/text') self.assertIn(b'register', response.data)