예제 #1
0
 def test_too_many_chars_user(self):
     tester = app.test_client(self)
     response = tester.post('/signup',
                            data=dict(username='******' * 31,
                                      email="*****@*****.**",
                                      password="******",
                                      confirmPassword="******",
                                      SignUpForm=""))
     self.assertIn(b'Must be between 5 and 30', response.data)
예제 #2
0
 def test_too_few_chars_pw(self):
     tester = app.test_client(self)
     response = tester.post('/signup',
                            data=dict(username='******',
                                      email="*****@*****.**",
                                      password="******",
                                      confirmPassword="******",
                                      SignUpForm=""))
     self.assertIn(b'Must be between 5 and 30', response.data)
예제 #3
0
 def test_correct_redirect_if_successful_signup_minCharLength(self):
     tester = app.test_client(self)
     response = tester.post('/signup',
                            data=dict(username="******",
                                      email="*****@*****.**",
                                      password="******",
                                      confirmPassword="******",
                                      SignUpForm=""),
                            follow_redirects=True)
     self.assertIn(b'Message', response.data)
예제 #4
0
 def test_pw_confirm(self):
     tester = app.test_client(self)
     response = tester.post('/signup',
                            data=dict(username="******",
                                      email="*****@*****.**",
                                      password="******",
                                      confirmPassword="******",
                                      SignUpForm=""),
                            follow_redirects=True)
     self.assertIn(b'Field must be equal to password.', response.data)
예제 #5
0
 def test_text_on_signup_page(self):
     tester = app.test_client(self)
     response = tester.get('/signup')
     self.assertIn(b'Sign Up Now!', response.data)
예제 #6
0
 def test_route_signup(self):
     tester = app.test_client(self)
     response = tester.get('/signup', content_type='html/text')
     self.assertEqual(response.status_code, 200)
예제 #7
0
 def test_text_on_home_page(self):
     tester = app.test_client(self)
     response = tester.get('/')
     self.assertIn(b'Welcome to the Home Page!', response.data)