def test_incorrect_login(self): tester = app.test_client(self) response = tester.post('/signin', data=dict(email="*****@*****.**", password="******"), follow_redirects=True) self.assertIn(b'Invalid e-mail or password', response.data)
def test_zero_delete_account(self): tester = app.test_client(self) tester.post('/signin', data=dict(email="*****@*****.**", password="******"), follow_redirects=True) response = tester.get('/delete', follow_redirects=True) self.assertIn(b'Welcome to APP', response.data)
def test_correct_login(self): tester = app.test_client(self) response = tester.post('/signin', data=dict(email="*****@*****.**", password="******"), follow_redirects=True) self.assertIn(b'Welcome [email protected]\'s profile page', response.data)
def test_account_signup(self): tester = app.test_client(self) tester.post('/signup', data=dict(firstname="test", lastname="test", email="*****@*****.**", password="******"), follow_redirects=True) response = tester.get('/profile', follow_redirects=True) self.assertIn(b'Welcome [email protected]\'s profile page', response.data)
def test_contact(self): tester = app.test_client(self) response = tester.post('/contact', data=dict(name="test", email="*****@*****.**", subject="test", message="Test Hello"), follow_redirects=True) #response = tester.get('/contact', follow_redirects=True) self.assertIn( b'Thank you for your message. We\'ll get back to you shortly.', response.data)
def test_add_friend(self): tester = app.test_client(self) tester.post('/signin', data=dict(email="*****@*****.**", password="******"), follow_redirects=True) tester.post('/friends', data=dict(f_firstname="test", f_lastname="test", f_email="*****@*****.**", f_phone="1234567890"), follow_redirects=True) response = tester.get('/showall', follow_redirects=True) self.assertIn(b'1234567890', response.data)
def test_main_route_requires_login(self): tester = app.test_client(self) response = tester.get('/profile', follow_redirects=True) self.assertTrue(b'Sign In' in response.data)
def test_login_page_loads(self): tester = app.test_client(self) response = tester.get('/signin', content_type='html/text') self.assertTrue(b'Sign In' in response.data)
def test_index(self): tester = app.test_client(self) response = tester.get('/', content_type='html/text') self.assertEqual(response.status_code, 200)