From f3f4a314025924bc818ac8a89e9c525352e04a8c Mon Sep 17 00:00:00 2001 From: Pierre Lalet Date: Wed, 22 May 2024 00:19:21 +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 5951f9a413e..9b45ec25e79 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(file, Test()) + self.assertEqual(1, len(findings)) + # test the filters + self.assertEqual(1, len(Finding.objects.filter(active=True)))