Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert use of network client in test utils. #12549

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions kolibri/core/auth/test/sync_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
import time
import uuid

import requests
from django.conf import settings
from django.db import connection
from django.db import connections
from django.utils.functional import wraps
from morango.models.core import DatabaseIDModel
from requests.exceptions import RequestException

from kolibri.core.auth.models import Facility
from kolibri.core.auth.models import FacilityUser
from kolibri.core.discovery.utils.network.client import NetworkClient
from kolibri.core.discovery.utils.network.errors import NetworkLocationResponseFailure

# custom Morango instance info used in tests
CUSTOM_INSTANCE_INFO = {"kolibri": "0.14.7"}
Expand Down Expand Up @@ -119,13 +119,12 @@ def pipe_shell(self, text):
)

def _wait_for_server_start(self, timeout=20):
client = NetworkClient.build_for_address(self.baseurl, timeout=3)
for i in range(timeout * 2):
try:
resp = client.get("api/public/info/")
resp = requests.get(self.baseurl + "api/public/info/", timeout=3)
if resp.status_code > 0:
return
except NetworkLocationResponseFailure:
except RequestException:
pass
time.sleep(0.5)

Expand Down