summaryrefslogtreecommitdiff
path: root/server/szurubooru/tests/func/test_snapshots.py
diff options
context:
space:
mode:
Diffstat (limited to 'server/szurubooru/tests/func/test_snapshots.py')
-rw-r--r--server/szurubooru/tests/func/test_snapshots.py42
1 files changed, 1 insertions, 41 deletions
diff --git a/server/szurubooru/tests/func/test_snapshots.py b/server/szurubooru/tests/func/test_snapshots.py
index da93530..dc68ff0 100644
--- a/server/szurubooru/tests/func/test_snapshots.py
+++ b/server/szurubooru/tests/func/test_snapshots.py
@@ -1,7 +1,7 @@
from datetime import datetime
from unittest.mock import patch
-import pytest
+import pytest # noqa: F401
from szurubooru import db, model
from szurubooru.func import snapshots, users
@@ -144,46 +144,6 @@ def test_create(tag_factory, user_factory):
assert results[0].data == "mocked"
-def test_modify_saves_non_empty_diffs(post_factory, user_factory):
- if "sqlite" in db.session.get_bind().driver:
- pytest.xfail(
- "SQLite doesn't support transaction isolation, "
- "which is required to retrieve original entity"
- )
- post = post_factory()
- post.notes = [model.PostNote(polygon=[(0, 0), (0, 1), (1, 1)], text="old")]
- user = user_factory()
- db.session.add_all([post, user])
- db.session.commit()
- post.source = "new source"
- post.notes = [model.PostNote(polygon=[(0, 0), (0, 1), (1, 1)], text="new")]
- db.session.flush()
- with patch("szurubooru.func.snapshots._post_to_webhooks"):
- snapshots.modify(post, user)
- db.session.flush()
- results = db.session.query(model.Snapshot).all()
- assert len(results) == 1
- assert results[0].data == {
- "type": "object change",
- "value": {
- "source": {
- "type": "primitive change",
- "old-value": None,
- "new-value": "new source",
- },
- "notes": {
- "type": "list change",
- "removed": [
- {"polygon": [[0, 0], [0, 1], [1, 1]], "text": "old"}
- ],
- "added": [
- {"polygon": [[0, 0], [0, 1], [1, 1]], "text": "new"}
- ],
- },
- },
- }
-
-
def test_modify_doesnt_save_empty_diffs(tag_factory, user_factory):
tag = tag_factory(names=["dummy"])
user = user_factory()