Я пытаюсь как-то сделать запрос на тестирование фляжного клиента для Евы:
@pytest.fixture(scope='session')
def client():
app = a.create_app()
app.debug = True
client = app.test_client()
return client
def animal_mes_id(client):
#res = client.get('/my_col?where={"_name": "animal"}')
res = client.get('/my_col', query_string={"_name": "animal"})
print(res.data)
return res.data......['_id'] # Schematic way to show I just want to get the _id
Я не смог ни так, ни иначе в следующих строках
#res = client.get('/my_col?where={"_name": "animal"}')
res = client.get('/my_col', query_string={"_name": "animal"})
передать --data-urlencode 'projection={"_id": 1}'
, поскольку это задокументировано
Я пробовал такие вещи, как:
client.get('/my_col?where={"_name": "animal"} --data-urlencode \'projection={"_id": 1}\'')