]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Adds documentation 2004/head
authorTrenton Holmes <797416+stumpylog@users.noreply.github.com>
Mon, 5 Dec 2022 00:50:11 +0000 (16:50 -0800)
committerTrenton Holmes <797416+stumpylog@users.noreply.github.com>
Mon, 5 Dec 2022 00:53:28 +0000 (16:53 -0800)
docs/administration.md
src/documents/tests/test_management_exporter.py

index a8009c85e82603ac3b719f89238daac3be9d8dd0..db29f3268765f1600359a3e4175fff808cf415e4 100644 (file)
@@ -233,6 +233,7 @@ optional arguments:
 -c, --compare-checksums
 -f, --use-filename-format
 -d, --delete
+-z  --zip
 ```
 
 `target` is a folder to which the data gets written. This includes
@@ -258,6 +259,9 @@ current export such as files from deleted documents, specify `--delete`.
 Be careful when pointing paperless to a directory that already contains
 other files.
 
+If `-z` or `--zip` is provided, the export will be a zipfile
+in the target directory, named according to the current date.
+
 The filenames generated by this command follow the format
 `[date created] [correspondent] [title].[extension]`. If you want
 paperless to use `PAPERLESS_FILENAME_FORMAT` for exported filenames
index fd9c9366d0f90edcc0098a29f69ee28ec894aca8..a24b292d700164f94a78a399b5f1cb77e5bcba02 100644 (file)
@@ -370,6 +370,15 @@ class TestExportImport(DirectoriesMixin, TestCase):
 
     @override_settings(PASSPHRASE="test")
     def test_export_zipped(self):
+        """
+        GIVEN:
+            - Request to export documents to zipfile
+        WHEN:
+            - Documents are exported
+        THEN:
+            - Zipfile is created
+            - Zipfile contains exported files
+        """
         shutil.rmtree(os.path.join(self.dirs.media_dir, "documents"))
         shutil.copytree(
             os.path.join(os.path.dirname(__file__), "samples", "documents"),
@@ -394,6 +403,16 @@ class TestExportImport(DirectoriesMixin, TestCase):
 
     @override_settings(PASSPHRASE="test")
     def test_export_zipped_format(self):
+        """
+        GIVEN:
+            - Request to export documents to zipfile
+            - Export is following filename formatting
+        WHEN:
+            - Documents are exported
+        THEN:
+            - Zipfile is created
+            - Zipfile contains exported files
+        """
         shutil.rmtree(os.path.join(self.dirs.media_dir, "documents"))
         shutil.copytree(
             os.path.join(os.path.dirname(__file__), "samples", "documents"),
@@ -415,7 +434,6 @@ class TestExportImport(DirectoriesMixin, TestCase):
         self.assertTrue(os.path.isfile(expected_file))
 
         with ZipFile(expected_file) as zip:
-            print(zip.namelist())
             # Extras are from the directories, which also appear in the listing
             self.assertEqual(len(zip.namelist()), 14)
             self.assertIn("manifest.json", zip.namelist())