def METHOD_NAME(app, login, query):
    """Search all records."""
    url = url_for('b2share_records_rest.b2rec_list')
    if query:
        url += "?q="+query
    with app.test_client() as client:
        res = client.get(url, headers=headers)
        assert res.status_code == 200
        search_json = json.loads(res.get_data(as_text=True))
        return search_json