Skip to content

Commit

Permalink
[Fixes #10302] test fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiagiupponi committed Nov 17, 2022
1 parent b4ac4ed commit 93685e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions geonode/base/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
#
#########################################################################

import ast
import os
import re
import sys
import json
import logging
import time
import gisdata

from PIL import Image
Expand Down Expand Up @@ -2452,6 +2454,13 @@ def test_resource_service_copy_with_perms_dataset_set_default_perms(self):

response = self.client.put(copy_url)
self.assertEqual(response.status_code, 200)

if ast.literal_eval(os.getenv("ASYNC_SIGNALS", "False")):
tentative = 1
while ExecutionRequest.objects.get(exec_id=response.json().get("execution_id")).status != ExecutionRequest.STATUS_FINISHED and tentative <= 3:
time.sleep(10)
tentative +=1

self.assertEqual('finished', self.client.get(response.json().get("status_url")).json().get("status"))
_resource = Dataset.objects.filter(title__icontains="test_copy_with_perms").last()
self.assertIsNotNone(_resource)
Expand Down

0 comments on commit 93685e0

Please sign in to comment.