Beispiel #1
0
 def setUp(self):
     self.ctx = app.test_request_context()
     self.ctx.push()
     init_data()
     self.client = app.test_client()
     builder = EnvironBuilder(method='POST')
     self.post_env = builder.get_environ()
 def setUp(self):
     self.ctx = app.test_request_context()
     self.ctx.push()
     init_data()
     self.client = app.test_client()
     ic = ItemCollection.query.first()
     self.resp = self.client.get('/ic/{ic}'.format(ic=ic.id), headers=[('X-Requested-With', 'XMLHttpRequest'), ('Origin', app.config['BASE_URL'])])
Beispiel #3
0
 def setUp(self):
     self.ctx = app.test_request_context()
     self.ctx.push()
     init_for('test')
     db.create_all()
     init_data()
     self.client = app.test_client()
Beispiel #4
0
 def setUp(self):
     self.ctx = app.test_request_context()
     self.ctx.push()
     init_data()
     self.client = app.test_client()
     builder = EnvironBuilder(method='POST')
     self.post_env = builder.get_environ()
Beispiel #5
0
 def setUp(self):
     self.ctx = app.test_request_context()
     self.ctx.push()
     init_for('test')
     db.create_all()
     init_data()
     self.client = app.test_client()
Beispiel #6
0
def client(request, db_session):
    """Provide a test client."""
    if 'noclient' in request.keywords:
        # To use this, annotate a test with:
        # @pytest.mark.noclient
        return None
    with app.app_context(
    ):  # Not required for test_client, but required for autouse
        with app.test_client() as test_client:
            yield test_client
Beispiel #7
0
 def setUp(self):
     self.ctx = app.test_request_context()
     self.ctx.push()
     init_data()
     self.client = app.test_client()
Beispiel #8
0
 def setUp(self):
     self.ctx = app.test_request_context()
     self.ctx.push()
     init_data()
     self.client = app.test_client()