-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make compatible with <1.0 and >1.0a #16
Conversation
def get_internal_database(ds): | ||
if hasattr(ds, "get_internal_database"): | ||
return ds.get_internal_database() | ||
else: | ||
return ds.get_database("_internal") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit of a gross hack here to get the internal database working in tests.
plugin_config={ | ||
"datasette-secrets": { | ||
"database": "_internal", | ||
"encryption-key": TEST_ENCRYPTION_KEY, | ||
} | ||
}, | ||
permissions={"manage-secrets": {"id": "admin"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this new feature in datasette-test
:
@@ -131,7 +136,7 @@ async def test_permissions(ds, path, verb, data, user): | |||
|
|||
@pytest.mark.asyncio | |||
async def test_set_secret(ds, use_actors_plugin): | |||
cookies = {"ds_actor": ds.client.actor_cookie({"id": "admin"})} | |||
cookies = {"ds_actor": actor_cookie(ds, {"id": "admin"})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this new feature in datasette-test
:
if hasattr(datasette, "actors_from_ids"): | ||
actors = await datasette.actors_from_ids( | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To compensate for datasette.actors_from_ids()
not being in Datasette <1.0
Permission tests are failing for the 1.0a version:
|
In the debugger for
|
Why did this check fail?
Here's why:
That's configured to allow |
Refs: