Example #1
0
	def test_data_appear_on_login(self):
		tester = dataApp.test_client(self)
		response = tester.post(
			'/login',
			data = dict(userName='******',password='******'),
			follow_redirects=True)
		self.assertIn('42', response.data)
Example #2
0
	def test_login_wrong(self):
		tester = dataApp.test_client(self)
		response = tester.post(
			'/login',
			data = dict(userName='******',password='******'),
			follow_redirects=True)
		self.assertIn('please', response.data)
Example #3
0
	def test_logout(self):
		tester = dataApp.test_client(self)
		tester.post(
			'/login',
			data = dict(userName='******',password='******'),
			follow_redirects=True)
		response = tester.get('/logout', content_type='html/text')
		self.assertIn('Thank you for visiting Simple Data', response.data)
Example #4
0
	def test_data_requires_login(self):
		tester = dataApp.test_client(self)
		response = tester.get('/data', follow_redirects=True)
		self.assertIn('please login to view', response.data)
Example #5
0
	def test_index(self):
		tester = dataApp.test_client(self)
		response = tester.get('/login', content_type='html/text')
		self.assertEqual(response.status_code,200)
Example #6
0
	def test_index_with_response(self):
		tester = dataApp.test_client(self)
		response = tester.get('/login', content_type='html/text')
		self.assertTrue('Welcome' in response.data)