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