Exemplo n.º 1
0
 def test_index(self):
     """inital test. ensure flask was set up correctly"""
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     self.assertEqual(response.status_code, 200)
Exemplo n.º 2
0
def client():
    reset_db()
    return app.test_client()
Exemplo n.º 3
0
 def setUp(self):
     """Set up a blank temp database before each test"""
     basedir = os.path.abspath(os.path.dirname(__file__))
     app.config['TESTING'] = True
     self.app = app.test_client()
Exemplo n.º 4
0
 def setUp(self):
     self.app = app
     self.app.config['TESTING'] = True
     self.client = app.test_client()
     self.payload = {'its': 'empty'}
Exemplo n.º 5
0
 def test_store_endpoint(self):
     client = app.test_client(self)
     response = client.post('/store/product-1/item', content_type='html/text')
     self.assertEqual(response.status_code, 200)
Exemplo n.º 6
0
 def test_store_has_data(self):
     client = app.test_client(self)
     response = client.get('/store/product-1/item', content_type='html/text')
     self.assertIn(b'product-1', response.data)
     self.assertEqual(response.status_code, 200)
Exemplo n.º 7
0
 def test_store_request(self):
     client = app.test_client(self)
     response = client.get('/store', content_type='html/text')
     self.assertEqual(response.status_code, 200)
Exemplo n.º 8
0
 def test_index_page_text(self):
     client = app.test_client(self)
     response = client.get('/', content_type='html/text')
     self.assertIn(b'Hello, World', response.data)