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
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()
def test_index(self): tester = app.test_client(self) response = tester.get('/', content_type='html/text') self.assertEqual(response.status_code, 200)
def test_index_name(self): tester = app.test_client(self) response = tester.get('/', content_type='html/text') self.assertTrue(b'Expense Amount', response.data)
def setUp(self): self.db_fd, app.config['DATABASE'] = tempfile.mkstemp() app.config['TESTING'] = True self.app = app.test_client() init_db()
def __init__(self): app.config['TESTING'] = True self.app = app.test_client()