From f884fb939278d80e13292ec15eea5bf96106a7d2 Mon Sep 17 00:00:00 2001 From: Pierre Lalet Date: Wed, 22 May 2024 00:31:34 +0200 Subject: [PATCH] fix(filters): mimic hit on /finding/open (test) --- unittests/tools/test_generic_parser.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/unittests/tools/test_generic_parser.py b/unittests/tools/test_generic_parser.py index 5951f9a413..55ffbd8f7c 100644 --- a/unittests/tools/test_generic_parser.py +++ b/unittests/tools/test_generic_parser.py @@ -650,3 +650,11 @@ def test_parse_json_invalid_finding(self): with self.assertRaisesMessage(ValueError, "Not allowed fields are present: ['invalid_field', 'last_status_update']"): parser.get_findings(file, Test()) + + def test_parse_json_bad_date(self): + with open("unittests/scans/generic/generic_bad_date.json") as fdesc: + parser = GenericParser() + findings = parser.get_findings(fdesc, Test()) + self.assertEqual(1, len(findings)) + # test the filters + self.assertEqual(1, len(Finding.objects.filter(active=True)))