Skip to content

Commit bdbe2bd

Browse files
committed
[tests] Fix tests
1 parent fc10459 commit bdbe2bd

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

openwisp_monitoring/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def get_settings_value(option, default=None):
2020
)
2121

2222
MONITORING_API_URLCONF = get_settings_value("API_URLCONF", None)
23-
MONITORING_API_BASEURL = None
23+
MONITORING_API_BASEURL = get_settings_value("API_BASEURL", None)
2424
MONITORING_TIMESERIES_RETRY_OPTIONS = get_settings_value(
2525
"TIMESERIES_RETRY_OPTIONS", dict(max_retries=6, delay=2)
2626
)

openwisp_monitoring/tests/test_selenium.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from openwisp_utils.tests import SeleniumTestMixin as BaseSeleniumTestMixin
3131

3232
from ..device import settings as device_app_settings
33-
from ..settings import MONITORING_API_URLCONF
3433

3534
Device = load_model("config", "Device")
3635
DeviceConnection = load_model("connection", "DeviceConnection")
@@ -69,16 +68,13 @@ def setUpClass(cls):
6968
DASHBOARD_TEMPLATES[0][1] = {
7069
"monitoring_device_list_url": reverse_lazy(
7170
"monitoring:api_location_device_list",
72-
urlconf=MONITORING_API_URLCONF,
7371
args=["000"],
7472
),
7573
"monitoring_location_geojson_url": reverse_lazy(
7674
"monitoring:api_location_geojson",
77-
urlconf=MONITORING_API_URLCONF,
7875
),
7976
"monitoring_indoor_coordinates_list": reverse_lazy(
8077
"monitoring:api_indoor_coordinates_list",
81-
urlconf=MONITORING_API_URLCONF,
8278
args=["000"],
8379
),
8480
"monitoring_labels": {
@@ -325,8 +321,6 @@ class TestDashboardMap(
325321
TestOrganizationMixin,
326322
ChannelsLiveServerTestCase,
327323
):
328-
retry_max = 1
329-
serve_static = True
330324
object_model = Device
331325
location_model = Location
332326
floorplan_model = Floorplan

tests/openwisp2/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@
230230
# for testing AUTO_IPERF3
231231
OPENWISP_MONITORING_AUTO_IPERF3 = True
232232

233+
if TESTING and "--exclude-tag=selenium_tests" not in sys.argv:
234+
OPENWISP_MONITORING_API_BASEURL = None
233235
# Temporarily added to identify slow tests
234236
TEST_RUNNER = "openwisp_utils.tests.TimeLoggingTestRunner"
235237

0 commit comments

Comments
 (0)