From 182a3017c24e3fa3af60e4ac0c91c7e48f8736fd Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sat, 25 May 2019 09:22:02 -0700 Subject: [PATCH] Sort keys to past tests in Python 3.5 --- datasette/facets.py | 1 + tests/test_facets.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/datasette/facets.py b/datasette/facets.py index 97ddfa07..7d7bd6d4 100644 --- a/datasette/facets.py +++ b/datasette/facets.py @@ -638,6 +638,7 @@ class ManyToManyFacet(Facet): "value": str(row["value"]), }, separators=(",", ":"), + sort_keys=True, ) selected = ("_through", through) in args if selected: diff --git a/tests/test_facets.py b/tests/test_facets.py index d2387d5c..b1037396 100644 --- a/tests/test_facets.py +++ b/tests/test_facets.py @@ -344,14 +344,14 @@ async def test_m2m_facet_results(app_client): "value": 2, "label": "Paranormal", "count": 3, - "toggle_url": "http://localhost/?_facet_m2m=attraction_characteristic&_through=%7B%22table%22%3A%22roadside_attraction_characteristics%22%2C%22column%22%3A%22characteristic_id%22%2C%22value%22%3A%222%22%7D", + "toggle_url": "http://localhost/?_facet_m2m=attraction_characteristic&_through=%7B%22column%22%3A%22characteristic_id%22%2C%22table%22%3A%22roadside_attraction_characteristics%22%2C%22value%22%3A%222%22%7D", "selected": False, }, { "value": 1, "label": "Museum", "count": 2, - "toggle_url": "http://localhost/?_facet_m2m=attraction_characteristic&_through=%7B%22table%22%3A%22roadside_attraction_characteristics%22%2C%22column%22%3A%22characteristic_id%22%2C%22value%22%3A%221%22%7D", + "toggle_url": "http://localhost/?_facet_m2m=attraction_characteristic&_through=%7B%22column%22%3A%22characteristic_id%22%2C%22table%22%3A%22roadside_attraction_characteristics%22%2C%22value%22%3A%221%22%7D", "selected": False, }, ],