Update facet tests

update-tests
Simon Willison 2020-02-12 22:24:05 -08:00
rodzic 298a899e79
commit 217c2969cf
3 zmienionych plików z 40 dodań i 40 usunięć

Wyświetl plik

@ -1319,8 +1319,8 @@ def test_page_size_matching_max_returned_rows(
{ {
"state": { "state": {
"name": "state", "name": "state",
"hideable": True,
"type": "column", "type": "column",
"hideable": True,
"toggle_url": "/fixtures/facetable.json?_facet=city_id", "toggle_url": "/fixtures/facetable.json?_facet=city_id",
"results": [ "results": [
{ {
@ -1349,8 +1349,8 @@ def test_page_size_matching_max_returned_rows(
}, },
"city_id": { "city_id": {
"name": "city_id", "name": "city_id",
"hideable": True,
"type": "column", "type": "column",
"hideable": True,
"toggle_url": "/fixtures/facetable.json?_facet=state", "toggle_url": "/fixtures/facetable.json?_facet=state",
"results": [ "results": [
{ {
@ -1360,13 +1360,6 @@ def test_page_size_matching_max_returned_rows(
"toggle_url": "_facet=state&_facet=city_id&city_id=1", "toggle_url": "_facet=state&_facet=city_id&city_id=1",
"selected": False, "selected": False,
}, },
{
"value": 2,
"label": "Los Angeles",
"count": 4,
"toggle_url": "_facet=state&_facet=city_id&city_id=2",
"selected": False,
},
{ {
"value": 3, "value": 3,
"label": "Detroit", "label": "Detroit",
@ -1374,6 +1367,13 @@ def test_page_size_matching_max_returned_rows(
"toggle_url": "_facet=state&_facet=city_id&city_id=3", "toggle_url": "_facet=state&_facet=city_id&city_id=3",
"selected": False, "selected": False,
}, },
{
"value": 2,
"label": "Los Angeles",
"count": 4,
"toggle_url": "_facet=state&_facet=city_id&city_id=2",
"selected": False,
},
{ {
"value": 4, "value": 4,
"label": "Memnonia", "label": "Memnonia",

Wyświetl plik

@ -115,13 +115,6 @@ async def test_column_facet_results(app_client):
"toggle_url": "http://localhost/?_facet=city_id&city_id=1", "toggle_url": "http://localhost/?_facet=city_id&city_id=1",
"selected": False, "selected": False,
}, },
{
"value": 2,
"label": "Los Angeles",
"count": 4,
"toggle_url": "http://localhost/?_facet=city_id&city_id=2",
"selected": False,
},
{ {
"value": 3, "value": 3,
"label": "Detroit", "label": "Detroit",
@ -129,6 +122,13 @@ async def test_column_facet_results(app_client):
"toggle_url": "http://localhost/?_facet=city_id&city_id=3", "toggle_url": "http://localhost/?_facet=city_id&city_id=3",
"selected": False, "selected": False,
}, },
{
"value": 2,
"label": "Los Angeles",
"count": 4,
"toggle_url": "http://localhost/?_facet=city_id&city_id=2",
"selected": False,
},
{ {
"value": 4, "value": 4,
"label": "Memnonia", "label": "Memnonia",
@ -168,13 +168,6 @@ async def test_column_facet_from_metadata_cannot_be_hidden(app_client):
"toggle_url": "http://localhost/?city_id=1", "toggle_url": "http://localhost/?city_id=1",
"selected": False, "selected": False,
}, },
{
"value": 2,
"label": "Los Angeles",
"count": 4,
"toggle_url": "http://localhost/?city_id=2",
"selected": False,
},
{ {
"value": 3, "value": 3,
"label": "Detroit", "label": "Detroit",
@ -182,6 +175,13 @@ async def test_column_facet_from_metadata_cannot_be_hidden(app_client):
"toggle_url": "http://localhost/?city_id=3", "toggle_url": "http://localhost/?city_id=3",
"selected": False, "selected": False,
}, },
{
"value": 2,
"label": "Los Angeles",
"count": 4,
"toggle_url": "http://localhost/?city_id=2",
"selected": False,
},
{ {
"value": 4, "value": 4,
"label": "Memnonia", "label": "Memnonia",
@ -253,13 +253,6 @@ async def test_array_facet_results(app_client):
"toggle_url": "http://localhost/?_facet_array=tags&tags__arraycontains=tag1", "toggle_url": "http://localhost/?_facet_array=tags&tags__arraycontains=tag1",
"selected": False, "selected": False,
}, },
{
"value": "tag2",
"label": "tag2",
"count": 1,
"toggle_url": "http://localhost/?_facet_array=tags&tags__arraycontains=tag2",
"selected": False,
},
{ {
"value": "tag3", "value": "tag3",
"label": "tag3", "label": "tag3",
@ -267,6 +260,13 @@ async def test_array_facet_results(app_client):
"toggle_url": "http://localhost/?_facet_array=tags&tags__arraycontains=tag3", "toggle_url": "http://localhost/?_facet_array=tags&tags__arraycontains=tag3",
"selected": False, "selected": False,
}, },
{
"value": "tag2",
"label": "tag2",
"count": 1,
"toggle_url": "http://localhost/?_facet_array=tags&tags__arraycontains=tag2",
"selected": False,
},
], ],
"hideable": True, "hideable": True,
"toggle_url": "/", "toggle_url": "/",
@ -292,10 +292,10 @@ async def test_date_facet_results(app_client):
"type": "date", "type": "date",
"results": [ "results": [
{ {
"value": "2019-01-14", "value": "2019-01-17",
"label": "2019-01-14", "label": "2019-01-17",
"count": 4, "count": 4,
"toggle_url": "http://localhost/?_facet_date=created&created__date=2019-01-14", "toggle_url": "http://localhost/?_facet_date=created&created__date=2019-01-17",
"selected": False, "selected": False,
}, },
{ {
@ -306,10 +306,10 @@ async def test_date_facet_results(app_client):
"selected": False, "selected": False,
}, },
{ {
"value": "2019-01-17", "value": "2019-01-14",
"label": "2019-01-17", "label": "2019-01-14",
"count": 4, "count": 4,
"toggle_url": "http://localhost/?_facet_date=created&created__date=2019-01-17", "toggle_url": "http://localhost/?_facet_date=created&created__date=2019-01-14",
"selected": False, "selected": False,
}, },
{ {

Wyświetl plik

@ -371,13 +371,13 @@ def test_facet_display(app_client):
"count": 6, "count": 6,
}, },
{ {
"name": "Los Angeles", "name": "Detroit",
"qs": "_facet=planet_int&_facet=city_id&_facet=on_earth&city_id=2", "qs": "_facet=planet_int&_facet=city_id&_facet=on_earth&city_id=3",
"count": 4, "count": 4,
}, },
{ {
"name": "Detroit", "name": "Los Angeles",
"qs": "_facet=planet_int&_facet=city_id&_facet=on_earth&city_id=3", "qs": "_facet=planet_int&_facet=city_id&_facet=on_earth&city_id=2",
"count": 4, "count": 4,
}, },
{ {