From a16a0e98838eaa661cde6f572074197387f51208 Mon Sep 17 00:00:00 2001 From: Kelvin Muchiri Date: Tue, 19 Nov 2024 11:02:14 +0300 Subject: [PATCH] add test --- onadata/apps/api/tests/viewsets/test_data_viewset.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/onadata/apps/api/tests/viewsets/test_data_viewset.py b/onadata/apps/api/tests/viewsets/test_data_viewset.py index a29220e59c..c584d9e92f 100644 --- a/onadata/apps/api/tests/viewsets/test_data_viewset.py +++ b/onadata/apps/api/tests/viewsets/test_data_viewset.py @@ -3810,6 +3810,15 @@ def test_submissions_deletion_in_progress(self): response = view(request, pk=formid) self.assertEqual(response.status_code, 200) self.assertEqual(len(response.data), 2) + # Cached submission ids saved as strings + cache.set( + f"xfm-submissions-deleting-{self.xform.pk}", + [str(instances[0].pk), str(instances[1].pk)], + ) + request = self.factory.get("/", **self.extra) + response = view(request, pk=formid) + self.assertEqual(response.status_code, 200) + self.assertEqual(len(response.data), 2) @override_settings(ENABLE_SUBMISSION_PERMANENT_DELETE=True) @patch(