Skip to content

Commit

Permalink
students: Increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
worldbeater committed Apr 19, 2024
1 parent f637e09 commit 4658abd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "app"
name = "webapp"
version = "0.1.0"
description = "DTA web app."
authors = ["Gorchakov A.V. and Contributors <[email protected]>"]
Expand Down
12 changes: 12 additions & 0 deletions tests/ui/test_submissions.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 4658abd

Please sign in to comment.