From 45c27dbc0b20890b1550975d7bd348ef18003064 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 15 Mar 2024 20:46:20 -0700 Subject: [PATCH] Use pathlib --- src/documents/tests/test_bulk_edit.py | 60 +++++++++++---------------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/src/documents/tests/test_bulk_edit.py b/src/documents/tests/test_bulk_edit.py index b77c20d61..097c12ead 100644 --- a/src/documents/tests/test_bulk_edit.py +++ b/src/documents/tests/test_bulk_edit.py @@ -285,57 +285,47 @@ class TestPDFActions(DirectoriesMixin, TestCase): super().setUp() sample1 = os.path.join(self.dirs.scratch_dir, "sample.pdf") shutil.copy( - os.path.join( - os.path.dirname(__file__), - "samples", - "documents", - "originals", - "0000001.pdf", - ), + Path(__file__).parent + / "samples" + / "documents" + / "originals" + / "0000001.pdf", sample1, ) sample1_archive = os.path.join(self.dirs.archive_dir, "sample_archive.pdf") shutil.copy( - os.path.join( - os.path.dirname(__file__), - "samples", - "documents", - "originals", - "0000001.pdf", - ), + Path(__file__).parent + / "samples" + / "documents" + / "originals" + / "0000001.pdf", sample1_archive, ) sample2 = os.path.join(self.dirs.scratch_dir, "sample2.pdf") shutil.copy( - os.path.join( - os.path.dirname(__file__), - "samples", - "documents", - "originals", - "0000002.pdf", - ), + Path(__file__).parent + / "samples" + / "documents" + / "originals" + / "0000002.pdf", sample2, ) sample2_archive = os.path.join(self.dirs.archive_dir, "sample2_archive.pdf") shutil.copy( - os.path.join( - os.path.dirname(__file__), - "samples", - "documents", - "originals", - "0000002.pdf", - ), + Path(__file__).parent + / "samples" + / "documents" + / "originals" + / "0000002.pdf", sample2_archive, ) sample3 = os.path.join(self.dirs.scratch_dir, "sample3.pdf") shutil.copy( - os.path.join( - os.path.dirname(__file__), - "samples", - "documents", - "originals", - "0000003.pdf", - ), + Path(__file__).parent + / "samples" + / "documents" + / "originals" + / "0000003.pdf", sample3, ) self.doc1 = Document.objects.create(checksum="A", title="A", filename=sample1)