1010from importer .handlers .base import BaseHandler
1111from importer .handlers .shapefile .serializer import ShapeFileSerializer
1212from importer .orchestrator import ImportOrchestrator
13- from geonode .upload .models import Upload
1413from django .utils import timezone
1514from django_celery_results .models import TaskResult
1615from geonode .assets .handlers import asset_handler_registry
1716
18- from geonode .base import enumerations as enum
1917from geonode .resource .models import ExecutionRequest
2018
2119# Create your tests here.
@@ -103,8 +101,6 @@ def test_create_execution_request(self):
103101 self .assertEqual (count + 1 , ExecutionRequest .objects .count ())
104102 self .assertDictEqual (input_files , exec_obj .input_params )
105103 self .assertEqual (exec_obj .STATUS_READY , exec_obj .status )
106- # check that also the legacy is created
107- self .assertIsNotNone (Upload .objects .get (metadata__icontains = exec_id ))
108104
109105 @patch ("importer.orchestrator.importer_app.tasks.get" )
110106 def test_perform_next_step (self , mock_celery ):
@@ -184,7 +180,6 @@ def test_perform_with_error_set_invalid_status(self, mock_celery):
184180 _excec = ExecutionRequest .objects .filter (exec_id = _id ).first ()
185181 self .assertIsNotNone (_excec )
186182 self .assertEqual (ExecutionRequest .STATUS_FAILED , _excec .status )
187- self .assertIsNotNone (Upload .objects .get (metadata__icontains = _id ))
188183
189184 def test_set_as_failed (self ):
190185 # creating the temporary file that will be deleted
@@ -227,14 +222,8 @@ def test_set_as_failed(self):
227222 self .assertTrue (req .status , ExecutionRequest .STATUS_FAILED )
228223 self .assertTrue (req .log , "automatic test" )
229224 self .assertFalse (os .path .exists (fake_path ))
230- # check legacy execution status
231- legacy = Upload .objects .filter (metadata__contains = _uuid )
232- self .assertTrue (legacy .exists ())
233- self .assertEqual (legacy .first ().state , enum .STATE_INVALID )
234-
235225 # cleanup
236226 req .delete ()
237- legacy .delete ()
238227
239228 def test_set_as_completed (self ):
240229 # we need to create first the execution
@@ -254,14 +243,8 @@ def test_set_as_completed(self):
254243 req = ExecutionRequest .objects .get (exec_id = _uuid )
255244 self .assertTrue (req .status , ExecutionRequest .STATUS_FINISHED )
256245
257- # check legacy execution status
258- legacy = Upload .objects .filter (metadata__contains = _uuid )
259- self .assertTrue (legacy .exists ())
260- self .assertEqual (legacy .first ().state , enum .STATE_PROCESSED )
261-
262246 # cleanup
263247 req .delete ()
264- legacy .delete ()
265248
266249 def test_update_execution_request_status (self ):
267250 # we need to create first the execution
@@ -287,14 +270,8 @@ def test_update_execution_request_status(self):
287270 self .assertTrue (req .func_name , "function_name" )
288271 self .assertTrue (req .step , "step_here" )
289272
290- # check legacy execution status
291- legacy = Upload .objects .filter (metadata__contains = _uuid )
292- self .assertTrue (legacy .exists ())
293- self .assertEqual (legacy .first ().state , enum .STATE_RUNNING )
294-
295273 # cleanup
296274 req .delete ()
297- legacy .delete ()
298275
299276 def test_evaluate_execution_progress_should_continue_if_some_task_is_not_finished (
300277 self ,
@@ -306,7 +283,6 @@ def test_evaluate_execution_progress_should_continue_if_some_task_is_not_finishe
306283 user = get_user_model ().objects .first (),
307284 func_name = "test" ,
308285 step = "test" ,
309- legacy_upload_name = "test" ,
310286 )
311287 )
312288
@@ -360,7 +336,6 @@ def test_evaluate_execution_progress_should_fail_if_one_task_is_failed(self):
360336 user = get_user_model ().objects .first (),
361337 func_name = "test" ,
362338 step = "test" ,
363- legacy_upload_name = "test" ,
364339 input_params = {
365340 "asset_id" : asset .id ,
366341 "asset_module_path" : f"{ asset .__module__ } .{ asset .__class__ .__name__ } " ,
@@ -389,7 +364,6 @@ def test_evaluate_execution_progress_should_set_as_completed(self):
389364 user = get_user_model ().objects .first (),
390365 func_name = "test" ,
391366 step = "test" ,
392- legacy_upload_name = "test" ,
393367 )
394368 )
395369
0 commit comments