diff --git a/Makefile b/Makefile index c69fc67..d465b51 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ flask: .PHONY: seed seed: - rm web-app.db + rm -f web-app.db python -m webapp.app --seed .PHONY: flask-win diff --git a/pyproject.toml b/pyproject.toml index 497bf56..576ac2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "app" +name = "webapp" version = "0.1.0" description = "DTA web app." authors = ["Gorchakov A.V. and Contributors "] diff --git a/tests/ui/test_submissions.py b/tests/ui/test_submissions.py index e697e30..0250d37 100644 --- a/tests/ui/test_submissions.py +++ b/tests/ui/test_submissions.py @@ -1,6 +1,7 @@ from secrets import token_hex from tests.database.test_check import arrange_task +from tests.ui.test_auth import create_student from tests.utils import mode, unique_str from flask.testing import FlaskClient @@ -23,6 +24,17 @@ def test_reg_cookie_is_not_set(db: AppDatabase, client: FlaskClient): assert not len(cookies) +@mode("registration") +def test_authorized_submissions(db: AppDatabase, client: FlaskClient): + email, password = create_student(db) + db.students.confirm(email) + + client.post("/login", data={'login': email, 'password': password}) + response = client.get('/submissions') + + assert response.status_code == 200 + + @mode("exam") def test_empty_submissions(db: AppDatabase, client: FlaskClient): session_id = token_hex(16)