Skip to content

Commit

Permalink
remove legacy test
Browse files Browse the repository at this point in the history
  • Loading branch information
ciur committed Nov 9, 2024
1 parent 5bd6f72 commit 62940bc
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions tests/core/test_page_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,38 +531,6 @@ def test_extract_two_pages_to_folder_each_page_in_separate_doc(_):
assert dst_pages2[0].text == src_ver.pages.all()[1].text


@patch("papermerge.core.signals.send_ocr_task")
def test_copy_without_pages(_):
"""Scenario
copy without page 1
ver X -> ver X + 1
S1 S2
S2
"""
user = user_recipe.make()
# 1. create a doc with two pages
# first page has word "cat"
# second page has word "dog"
src = maker.document(resource="living-things.pdf", user=user, include_ocr_data=True)
orig_doc_ver = src.versions.last()
orig_first_page = orig_doc_ver.pages.all()[0]
orig_second_page = orig_doc_ver.pages.all()[1]
orig_first_page.text = "cat"
orig_second_page.text = "dog"
orig_first_page.save()
orig_second_page.save()
# page containing "cat" / first page is left behind
pages_to_leave_behind = [orig_doc_ver.pages.first().id]

[_, new_ver, _] = copy_without_pages(pages_to_leave_behind)

assert new_ver.pages.count() == 1
# new version contains only 'dog'
assert ["dog"] == [p.text for p in new_ver.pages.all()]
assert new_ver.text == "dog"


class PageDir:
"""Helper class to test if content of two dirs is same
Expand Down

0 comments on commit 62940bc

Please sign in to comment.