From 5e20d1d5540629bc769573db8cdcbb12a4e4ea49 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Wed, 16 May 2018 13:46:07 -0700 Subject: [PATCH] metadata: Fix failing test on __getitem__['/CreationDate'] --- tests/test_metadata.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 23f47c40..9de23ecd 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -145,8 +145,7 @@ def test_creation_date_preserved(spoof_tesseract_noop, output_type, resources, # because of Ghostscript quirks we set it to null # This test would be better if we had a test file with /DocumentInfo but # no /CreationDate, which we don't - assert not after['/CreationDate'] or \ - isinstance(after['/CreationDate'], pypdf.generic.NullObject) + assert not after.get('/CreationDate') else: # We expect that the creation date stayed the same date_before = decode_pdf_date(before['/CreationDate'])