mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	fix some test cases due to renamed test files
This commit is contained in:
		| @@ -70,18 +70,18 @@ class TestDecryptDocuments(TestCase): | |||||||
|             PASSPHRASE="test" |             PASSPHRASE="test" | ||||||
|         ).enable() |         ).enable() | ||||||
|  |  | ||||||
|         doc = Document.objects.create(checksum="9c9691e51741c1f4f41a20896af31770", title="wow", filename="0000002.pdf.gpg",  mime_type="application/pdf", storage_type=Document.STORAGE_TYPE_GPG) |         doc = Document.objects.create(checksum="82186aaa94f0b98697d704b90fd1c072", title="wow", filename="0000004.pdf.gpg",  mime_type="application/pdf", storage_type=Document.STORAGE_TYPE_GPG) | ||||||
|  |  | ||||||
|         shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "documents", "originals", "0000002.pdf.gpg"), os.path.join(originals_dir, "0000002.pdf.gpg")) |         shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "documents", "originals", "0000004.pdf.gpg"), os.path.join(originals_dir, "0000004.pdf.gpg")) | ||||||
|         shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "documents", "thumbnails", f"0000002.png.gpg"), os.path.join(thumb_dir, f"{doc.id:07}.png.gpg")) |         shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "documents", "thumbnails", f"0000004.png.gpg"), os.path.join(thumb_dir, f"{doc.id:07}.png.gpg")) | ||||||
|  |  | ||||||
|         call_command('decrypt_documents') |         call_command('decrypt_documents') | ||||||
|  |  | ||||||
|         doc.refresh_from_db() |         doc.refresh_from_db() | ||||||
|  |  | ||||||
|         self.assertEqual(doc.storage_type, Document.STORAGE_TYPE_UNENCRYPTED) |         self.assertEqual(doc.storage_type, Document.STORAGE_TYPE_UNENCRYPTED) | ||||||
|         self.assertEqual(doc.filename, "0000002.pdf") |         self.assertEqual(doc.filename, "0000004.pdf") | ||||||
|         self.assertTrue(os.path.isfile(os.path.join(originals_dir, "0000002.pdf"))) |         self.assertTrue(os.path.isfile(os.path.join(originals_dir, "0000004.pdf"))) | ||||||
|         self.assertTrue(os.path.isfile(doc.source_path)) |         self.assertTrue(os.path.isfile(doc.source_path)) | ||||||
|         self.assertTrue(os.path.isfile(os.path.join(thumb_dir, f"{doc.id:07}.png"))) |         self.assertTrue(os.path.isfile(os.path.join(thumb_dir, f"{doc.id:07}.png"))) | ||||||
|         self.assertTrue(os.path.isfile(doc.thumbnail_path)) |         self.assertTrue(os.path.isfile(doc.thumbnail_path)) | ||||||
|   | |||||||
| @@ -98,7 +98,7 @@ class TestMigrateMimeType(DirectoriesMixin, TestMigrations): | |||||||
|  |  | ||||||
|         doc2 = Document.objects.create(checksum="B", file_type="pdf", storage_type=STORAGE_TYPE_GPG) |         doc2 = Document.objects.create(checksum="B", file_type="pdf", storage_type=STORAGE_TYPE_GPG) | ||||||
|         self.doc2_id = doc2.id |         self.doc2_id = doc2.id | ||||||
|         shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "documents", "originals", "0000002.pdf.gpg"), source_path_before(doc2)) |         shutil.copy(os.path.join(os.path.dirname(__file__), "samples", "documents", "originals", "0000004.pdf.gpg"), source_path_before(doc2)) | ||||||
|  |  | ||||||
|     def testMimeTypesMigrated(self): |     def testMimeTypesMigrated(self): | ||||||
|         Document = self.apps.get_model('documents', 'Document') |         Document = self.apps.get_model('documents', 'Document') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler