Exemplo n.º 1
0
    def test_retrieving_pending_export(self):
        self._create_user_and_login()
        self._publish_transportation_form()

        export = Export(xform=self.xform,
                        export_type=Export.CSV_EXPORT,
                        options={},
                        task_id="abcsde")

        export.save()

        test_export = check_pending_export(self.xform, Export.CSV_EXPORT, {})

        self.assertEqual(export, test_export)

        test_export = check_pending_export(self.xform, Export.XLS_EXPORT, {})

        self.assertIsNone(test_export)

        export.created_on = export.created_on - timedelta(minutes=6)
        export.save()

        test_export = check_pending_export(self.xform, Export.CSV_EXPORT, {})

        self.assertIsNone(test_export)
Exemplo n.º 2
0
    def test_retrieving_pending_export(self):
        self._create_user_and_login()
        self._publish_transportation_form()

        export = Export(
            xform=self.xform,
            export_type=Export.CSV_EXPORT,
            options={},
            task_id="abcsde")

        export.save()

        test_export = check_pending_export(self.xform, Export.CSV_EXPORT, {})

        self.assertEqual(export, test_export)

        test_export = check_pending_export(self.xform, Export.XLS_EXPORT, {})

        self.assertIsNone(test_export)

        export.created_on = export.created_on - timedelta(minutes=6)
        export.save()

        test_export = check_pending_export(self.xform, Export.CSV_EXPORT, {})

        self.assertIsNone(test_export)