Exemplo n.º 1
0
 def setUp(self):
     """
         Set up configuration for the test create an test client and 
         configure the application in TESTING mode.
     """
     self.c= app.test_client()
     app.config['TESTING'] = True
Exemplo n.º 2
0
    def setUp(self, url=None, auth=False):
        self.c = app.test_client()
        self.url = url
        app.config["TESTING"] = True
        if auth and self.auth_token is None:
            rv = login(self.c, "admin", "admin")
            self.auth_token = json.loads(rv.data)["token"]

        self.clear_auth()
Exemplo n.º 3
0
 def test_index(self):
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     self.assertEqual(response.status_code, 200)
Exemplo n.º 4
0
 def test_index_name(self):
     tester = app.test_client(self)
     response = tester.get('/', content_type='html/text')
     self.assertTrue(b'Expense Amount', response.data)
Exemplo n.º 5
0
 def setUp(self):
     self.db_fd, app.config['DATABASE'] = tempfile.mkstemp()
     app.config['TESTING'] = True
     self.app = app.test_client()
     init_db()
Exemplo n.º 6
0
 def __init__(self):
     app.config['TESTING'] = True
     self.app = app.test_client()