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)
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)
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)
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)
def test_text_on_signup_page(self): tester = app.test_client(self) response = tester.get('/signup') self.assertIn(b'Sign Up Now!', response.data)
def test_route_signup(self): tester = app.test_client(self) response = tester.get('/signup', content_type='html/text') self.assertEqual(response.status_code, 200)
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)