A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
more test
jonaswinkler9f1436a86562
diff --git a/src/documents/tests/test_api.py b/src/documents/tests/test_api.pyindex 5f81b83b6..6b9cf14e0 100644--- a/src/documents/tests/test_api.py+++ b/src/documents/tests/test_api.py@@ -923,6 +923,14 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):doc2 = Document.objects.get(id=self.doc2.id)self.assertEqual(doc2.correspondent, self.c1)+ def test_api_no_correspondent(self):+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({+ "documents": [self.doc2.id],+ "method": "set_correspondent",+ "parameters": {}+ }), content_type='application/json')+ self.assertEqual(response.status_code, 400)+def test_api_invalid_document_type(self):self.assertEqual(self.doc2.document_type, self.dt1)response = self.client.post("/api/documents/bulk_edit/", json.dumps({@@ -935,6 +943,14 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):doc2 = Document.objects.get(id=self.doc2.id)self.assertEqual(doc2.document_type, self.dt1)+ def test_api_no_document_type(self):+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({+ "documents": [self.doc2.id],+ "method": "set_document_type",+ "parameters": {}+ }), content_type='application/json')+ self.assertEqual(response.status_code, 400)+def test_api_add_invalid_tag(self):self.assertEqual(list(self.doc2.tags.all()), [self.t1])response = self.client.post("/api/documents/bulk_edit/", json.dumps({@@ -946,6 +962,14 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):self.assertEqual(list(self.doc2.tags.all()), [self.t1])+ def test_api_add_tag_no_tag(self):+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({+ "documents": [self.doc2.id],+ "method": "add_tag",+ "parameters": {}+ }), content_type='application/json')+ self.assertEqual(response.status_code, 400)+def test_api_delete_invalid_tag(self):self.assertEqual(list(self.doc2.tags.all()), [self.t1])response = self.client.post("/api/documents/bulk_edit/", json.dumps({@@ -957,6 +981,14 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):self.assertEqual(list(self.doc2.tags.all()), [self.t1])+ def test_api_delete_tag_no_tag(self):+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({+ "documents": [self.doc2.id],+ "method": "remove_tag",+ "parameters": {}+ }), content_type='application/json')+ self.assertEqual(response.status_code, 400)+def test_api_modify_invalid_tags(self):self.assertEqual(list(self.doc2.tags.all()), [self.t1])response = self.client.post("/api/documents/bulk_edit/", json.dumps({@@ -966,6 +998,21 @@ class TestBulkEdit(DirectoriesMixin, APITestCase):}), content_type='application/json')self.assertEqual(response.status_code, 400)+ def test_api_modify_tags_no_tags(self):+ response = self.client.post("/api/documents/bulk_edit/", json.dumps({+ "documents": [self.doc2.id],+ "method": "modify_tags",+ "parameters": {"remove_tags": [1123123]}+ }), content_type='application/json')+ self.assertEqual(response.status_code, 400)++ response = self.client.post("/api/documents/bulk_edit/", json.dumps({+ "documents": [self.doc2.id],+ "method": "modify_tags",+ "parameters": {'add_tags': [self.t2.id, 1657]}+ }), content_type='application/json')+ self.assertEqual(response.status_code, 400)+def test_api_selection_data_empty(self):response = self.client.post("/api/documents/selection_data/", json.dumps({"documents": []diff --git a/src/documents/tests/test_parsers.py b/src/documents/tests/test_parsers.pyindex 805e4beac..392c0504f 100644--- a/src/documents/tests/test_parsers.py+++ b/src/documents/tests/test_parsers.py@@ -120,3 +120,4 @@ class TestParserAvailability(TestCase):self.assertTrue(is_file_ext_supported('.pdf'))self.assertFalse(is_file_ext_supported('.hsdfh'))+ self.assertFalse(is_file_ext_supported(''))