kopia lustrzana https://github.com/simonw/datasette
rodzic
481eb96d85
commit
a3e6f1b167
|
@ -45,7 +45,8 @@
|
|||
{% endif %}
|
||||
{% if not hide_sql %}
|
||||
{% if editable and allow_execute_sql %}
|
||||
<p><textarea id="sql-editor" name="sql">{% if query and query.sql %}{{ query.sql }}{% else %}select * from {{ tables[0].name|escape_sqlite }}{% endif %}</textarea></p>
|
||||
<p><textarea id="sql-editor" name="sql"{% if query and query.sql %} style="height: {{ query.sql.split("\n")|length + 2 }}em"{% endif %}
|
||||
>{% if query and query.sql %}{{ query.sql }}{% else %}select * from {{ tables[0].name|escape_sqlite }}{% endif %}</textarea></p>
|
||||
{% else %}
|
||||
<pre id="sql-query">{% if query %}{{ query.sql }}{% endif %}</pre>
|
||||
{% endif %}
|
||||
|
|
|
@ -695,10 +695,8 @@ def test_query_error(app_client):
|
|||
response = app_client.get("/fixtures?sql=select+*+from+notatable")
|
||||
html = response.text
|
||||
assert '<p class="message-error">no such table: notatable</p>' in html
|
||||
assert (
|
||||
'<textarea id="sql-editor" name="sql">select * from notatable</textarea>'
|
||||
in html
|
||||
)
|
||||
assert '<textarea id="sql-editor" name="sql" style="height: 3em' in html
|
||||
assert ">select * from notatable</textarea>" in html
|
||||
assert "0 results" not in html
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue