From a85d6cdc3831ddf2f076905fe8ea107f1509a3d1 Mon Sep 17 00:00:00 2001 From: s0llvan <178677095+s0llvan@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:38:17 +0000 Subject: [PATCH] Refactor file copy to use Path instead of os.path.join --- src/documents/tests/test_migration_document_pages_count.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/documents/tests/test_migration_document_pages_count.py b/src/documents/tests/test_migration_document_pages_count.py index 811633330..2f03e013e 100644 --- a/src/documents/tests/test_migration_document_pages_count.py +++ b/src/documents/tests/test_migration_document_pages_count.py @@ -1,5 +1,6 @@ import os import shutil +from pathlib import Path from django.conf import settings @@ -26,7 +27,7 @@ class TestMigrateDocumentPagesCount(TestMigrations): ) self.doc_id = doc.id shutil.copy( - os.path.join(os.path.dirname(__file__), "samples", "simple.pdf"), + Path(__file__).parent / "samples" / "simple.pdf", source_path_before(doc), )