diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/conftest.py | 2 | ||||
| -rw-r--r-- | tests/test_auth.py | 13 | ||||
| -rw-r--r-- | tests/test_users.py | 5 |
3 files changed, 16 insertions, 4 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 1e41314..459e3cb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -46,7 +46,7 @@ class AuthActions(object): def login(self, username="test", password="test"): return self._client.post( "/auth/login", - data=json.dumps({"username": username, "password": password,}), + data=json.dumps({"username": username, "password": password}), headers={"content-type": "application/json"}, ) 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 diff --git a/tests/test_users.py b/tests/test_users.py index c3c2373..057d4e3 100644 --- a/tests/test_users.py +++ b/tests/test_users.py @@ -100,7 +100,10 @@ def test_get_user_inbox_page_latest(app, client, auth): @pytest.mark.parametrize( ("payload", "expected_status_code", "expected_inbox_size_increase"), - (('{"id": "dummy_id"}', 200, 1), ("", 400, 0),), + ( + ('{"id": "dummy_id"}', 200, 1), + ("", 400, 0), + ), ) def test_post_user_inbox_item( app, client, auth, payload, expected_status_code, expected_inbox_size_increase |
