mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-26 03:36:08 -05:00 
			
		
		
		
	more testing.
This commit is contained in:
		| @@ -12,10 +12,10 @@ from documents.models import Document, Correspondent, DocumentType, Tag | ||||
| from documents.tests.utils import DirectoriesMixin | ||||
|  | ||||
|  | ||||
| class DocumentApiTest(DirectoriesMixin, APITestCase): | ||||
| class TestDocumentApi(DirectoriesMixin, APITestCase): | ||||
|  | ||||
|     def setUp(self): | ||||
|         super(DocumentApiTest, self).setUp() | ||||
|         super(TestDocumentApi, self).setUp() | ||||
|  | ||||
|         user = User.objects.create_superuser(username="temp_admin") | ||||
|         self.client.force_login(user=user) | ||||
|   | ||||
| @@ -435,6 +435,7 @@ class TestConsumer(DirectoriesMixin, TestCase): | ||||
|         fd, f = tempfile.mkstemp(suffix=".pdf", dir=self.dirs.scratch_dir) | ||||
|         return f | ||||
|  | ||||
|     @override_settings(PAPERLESS_FILENAME_FORMAT=None) | ||||
|     def testNormalOperation(self): | ||||
|  | ||||
|         filename = self.get_test_file() | ||||
|   | ||||
| @@ -17,7 +17,8 @@ class TestDecryptDocuments(TestCase): | ||||
|     @override_settings( | ||||
|         ORIGINALS_DIR=os.path.join(os.path.dirname(__file__), "samples", "originals"), | ||||
|         THUMBNAIL_DIR=os.path.join(os.path.dirname(__file__), "samples", "thumb"), | ||||
|         PASSPHRASE="test" | ||||
|         PASSPHRASE="test", | ||||
|         PAPERLESS_FILENAME_FORMAT=None | ||||
|     ) | ||||
|     @mock.patch("documents.management.commands.decrypt_documents.input") | ||||
|     def test_decrypt(self, m): | ||||
|   | ||||
							
								
								
									
										23
									
								
								src/documents/tests/test_tasks.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/documents/tests/test_tasks.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| from datetime import datetime | ||||
|  | ||||
| from django.test import TestCase | ||||
|  | ||||
| from documents import tasks | ||||
| from documents.models import Document | ||||
| from documents.tests.utils import DirectoriesMixin | ||||
|  | ||||
|  | ||||
| class TestTasks(DirectoriesMixin, TestCase): | ||||
|  | ||||
|     def test_index_reindex(self): | ||||
|         Document.objects.create(title="test", content="my document", checksum="wow", added=datetime.now(), created=datetime.now(), modified=datetime.now()) | ||||
|  | ||||
|         tasks.index_reindex() | ||||
|  | ||||
|     def test_index_optimize(self): | ||||
|         Document.objects.create(title="test", content="my document", checksum="wow", added=datetime.now(), created=datetime.now(), modified=datetime.now()) | ||||
|  | ||||
|         tasks.index_optimize() | ||||
|  | ||||
|     def test_train_classifier(self): | ||||
|         tasks.train_classifier() | ||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler