From b07312c2b3bc7e4a9298c1f291f420bd92b6f842 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 2 Apr 2020 17:54:27 -0700 Subject: [PATCH] dedent SQL for neighborhood_search fixture Makes this page a little prettier: https://latest.datasette.io/fixtures/neighborhood_search --- tests/fixtures.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/fixtures.py b/tests/fixtures.py index e0b56afe..8459fd4f 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -11,6 +11,7 @@ import random import sys import string import tempfile +import textwrap import time from urllib.parse import unquote, quote @@ -311,14 +312,16 @@ METADATA = { "𝐜𝐢𝐭𝐢𝐞𝐬": "select id, name from facet_cities order by id limit 1;", "pragma_cache_size": "PRAGMA cache_size;", "neighborhood_search": { - "sql": """ + "sql": textwrap.dedent( + """ select neighborhood, facet_cities.name, state from facetable join facet_cities on facetable.city_id = facet_cities.id where neighborhood like '%' || :text || '%' order by neighborhood; - """, + """ + ), "title": "Search neighborhoods", "description_html": "Demonstrating simple like search", },