(client, app)
| 6 | |
| 7 | |
| 8 | def test_register(client, app): |
| 9 | # test that viewing the page renders without template errors |
| 10 | assert client.get("/auth/register").status_code == 200 |
| 11 | |
| 12 | # test that successful registration redirects to the login page |
| 13 | response = client.post("/auth/register", data={"username": "a", "password": "a"}) |
| 14 | assert response.headers["Location"] == "/auth/login" |
| 15 | |
| 16 | # test that the user was inserted into the database |
| 17 | with app.app_context(): |
| 18 | assert ( |
| 19 | get_db().execute("SELECT * FROM user WHERE username = 'a'").fetchone() |
| 20 | is not None |
| 21 | ) |
| 22 | |
| 23 | |
| 24 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected