Verified Commit 21a503d6 authored by Kristyna Pekarkova's avatar Kristyna Pekarkova Committed by Peter Stanko
Browse files

Changed review item tests

parent c3603889
......@@ -967,7 +967,8 @@ def test_review_item_version_create_valid(session, course1, user1):
assert ri2.versions[0].index == 0
def test_review_item_version_update_valid(session, course1, user1):
@pytest.fixture()
def versioned_review_item(session, course1, user1, app) -> ReviewItem:
project = Project(course=course1, name="p1")
submission = Submission(user=user1, project=project, parameters={})
......@@ -978,6 +979,13 @@ def test_review_item_version_update_valid(session, course1, user1):
ri1 = ReviewItem(user=user1, review=review, file="foo", line=10, content="something")
session.commit()
yield ri1
from tests import init_db
init_db(app)
def test_review_item_version_update_valid(session, course1, user1, versioned_review_item):
ri1 = versioned_review_item
assert ri1 in user1.review_items
assert ri1.versions[0].index == 0
......@@ -990,10 +998,7 @@ def test_review_item_version_update_valid(session, course1, user1):
session.commit()
assert ri1 in user1.review_items
assert ri1.versions[2].index == 2
assert ri1.versions[2].content == "new content"
assert len(versioned_review_item.versions.all()) == 3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment