diff options
| author | Tom Harley | 2021-08-01 14:27:21 +0000 |
|---|---|---|
| committer | Tom Harley | 2021-08-02 14:41:06 +0000 |
| commit | bafe42275e65b98951dd3335342e38d7bf1b1db5 (patch) | |
| tree | 69af3fd0d1ff77baea81a3396a45c7287afdecc0 /tests/test_auth.py | |
| parent | Support dev environment via nix-shell (diff) | |
| download | swap-untested.tar.gz swap-untested.zip | |
Utilise jinja inheritance to streamline in/outbox
untestedUsing jinja’s templating extensions, we can recreate the activitypub inheritance hierarchy without using clunky python OO.
Extending from multiple template files in sequence might cause unnecesary IO to slow response times; if this ever becomes an issue, it should be possible to pre-process some of the templating since a lot of it will be based on constant expressions (such as @context and type).
I think some formatting fixes leaked into this commit; oops! I’m leaving this note here in the hopes that if I ever want to clean this up, I can locate this commit easier.
Diffstat (limited to 'tests/test_auth.py')
| -rw-r--r-- | tests/test_auth.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/test_auth.py b/tests/test_auth.py index 96dd959..db55df7 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -11,7 +11,12 @@ from werkzeug.datastructures import Headers def test_register(client, app): response = client.post( "/auth/register", - data=json.dumps({"username": "a", "password": "a",}), + data=json.dumps( + { + "username": "a", + "password": "a", + } + ), content_type="application/json", ) @@ -19,7 +24,11 @@ def test_register(client, app): with app.app_context(): db_result = ( - get_db().execute("select * from users where username='a'",).fetchone() + get_db() + .execute( + "select * from users where username='a'", + ) + .fetchone() ) assert db_result is not None |
