Ejemplo n.º 1
0
 def setUp(self):
     self.db_fd, app.config['DATABASE'] = tempfile.mkstemp()
     app.config['TESTING'] = True
     self.app = app.test_client()
     with app.test_request_context():
         g.connection = connect_db()
         g.db = g.connection['game']['games']
         init_db()
Ejemplo n.º 2
0
 def setUp(self):
     self.db_fd, app.config['DATABASE'] = tempfile.mkstemp()
     app.config['TESTING'] = True
     self.app = app.test_client()
     with app.test_request_context():
         g.connection = connect_db()
         g.db = g.connection['game']['games']
         init_db()
Ejemplo n.º 3
0
def before_request():
    g.connection = connect_db()
    g.db = g.connection[DATABASE][COLLECTION]