Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 def test_index(self):
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     self.assertEqual(response.status_code, 200)
Example #7
0
 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)