Simon Willison
7c6a9c3529
Better tests for prepare_connection() plugin hook, refs #678
2020-02-21 18:27:07 -08:00
Simon Willison
8c642f04e0
Render templates using Jinja async mode
...
Closes #628
2019-11-14 15:14:22 -08:00
Simon Willison
fcfcae21e6
extra_template_vars plugin hook ( #542 )
...
* extra_template_vars plugin hook
Closes #541
* Workaround for cwd bug
Based on https://github.com/pytest-dev/pytest/issues/1235#issuecomment-175295691
2019-07-05 17:05:56 -07:00
Simon Willison
25ff0a8ba6
Fix for accidentally leaking secrets in /-/metadata, closes #538
2019-07-03 22:47:45 -07:00
Simon Willison
a2d4593193
Secret plugin configuration options ( #539 )
...
Closes #538
2019-07-03 22:36:44 -07:00
Simon Willison
4d2fdafe39
Added asgi_wrapper plugin hook, closes #520
2019-07-02 21:06:25 -07:00
Simon Willison
35d6ee2790
Apply black to everything, enforce via unit tests ( #449 )
...
I've run the black code formatting tool against everything:
black tests datasette setup.py
I also added a new unit test, in tests/test_black.py, which will fail if the code does not
conform to black's exacting standards.
This unit test only runs on Python 3.6 or higher, because black itself doesn't run on 3.5.
2019-05-03 22:15:14 -04:00
Simon Willison
b7257a21bf
Fix json.loads in Python 3.5
...
3.5 requires a str, not a bytes
https://travis-ci.org/simonw/datasette/jobs/421660555
2018-08-28 17:55:30 +01:00
Simon Willison
b7c6a9f9bd
extra_css_urls(template, database, table, datasette)
...
The extra_css_urls and extra_js_urls hooks now take additional optional
parameters.
Also refactored them out of the Datasette class and into RenderMixin.
Plus improved plugin documentation to explicitly list parameters.
2018-08-28 11:56:57 +01:00
Simon Willison
2e836f72d9
render_cell(value, column, table, database, datasette)
...
The render_cell plugin hook previously was only passed value.
It is now passed (value, column, table, database, datasette).
2018-08-28 03:03:01 -07:00
Simon Willison
5cf0c6c91c
New plugin hook: extra_body_script
2018-08-28 02:02:49 -07:00
Simon Willison
0a14a4846b
Added plugin_config() method
2018-08-28 01:35:21 -07:00
Simon Willison
4ac9132240
render_cell(value) plugin hook, closes #352
...
New plugin hook for customizing the way cells values are rendered in HTML.
The first full example of this hook in use is https://github.com/simonw/datasette-json-html
2018-08-04 17:14:56 -07:00
Simon Willison
0357774c94
Renamed test_tables.db to fixtures.db in unit tests
2018-06-17 11:34:16 -07:00
Simon Willison
864328e074
Test client wrapper removing need for gather_request - refs #272
...
As part of decoupling from Sanic, this will make it easier to run tests
against ASGI instead.
2018-06-04 20:53:12 -07:00
Simon Willison
969771770f
Upgrade pytest to 3.6.0
...
https://github.com/pytest-dev/pytest/issues/1875 made it impossible to declare
a function as a fixture multiple times, which we were doing across different
modules. The fix was to move our @pytest.fixture calls into decorators in the
tests/fixtures.py module.
2018-05-31 06:42:37 -07:00
Simon Willison
98c8f0e728
Moved plugin HTML tests from test_html to test_plugins
2018-05-28 14:23:48 -07:00
Simon Willison
fefb0db8ae
Unit test for 02870e57
, closes #291
2018-05-28 13:41:53 -07:00