Skip to content

Commit 0ac08fb

Browse files
committed
[tests] Switched selenium tests to ChannelsLiveServerTestCase
1 parent ba5e7a1 commit 0ac08fb

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

openwisp_controller/geo/tests/test_selenium.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from channels.testing import ChannelsLiveServerTestCase
12
from django.contrib.auth import get_user_model
23
from django.contrib.auth.models import Permission
3-
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
44
from django.test import tag
55
from django.urls.base import reverse
66
from django_loci.tests import TestAdminMixin
@@ -22,7 +22,10 @@
2222
# these tests are for geo elements on device admin
2323
@tag("selenium_tests")
2424
class TestDeviceAdminGeoSelenium(
25-
BaseTestDeviceAdminSelenium, TestOrganizationMixin, StaticLiveServerTestCase
25+
TestGeoMixin,
26+
BaseTestDeviceAdminSelenium,
27+
TestOrganizationMixin,
28+
ChannelsLiveServerTestCase,
2629
):
2730
app_label = "geo"
2831
object_model = Device
@@ -66,7 +69,7 @@ class TestDeviceAdminReadonly(
6669
TestGeoMixin,
6770
TestAdminMixin,
6871
SeleniumTestMixin,
69-
StaticLiveServerTestCase,
72+
ChannelsLiveServerTestCase,
7073
):
7174
browser = "chrome"
7275
app_label = "geo"

tests/openwisp2/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"NAME": os.path.join(BASE_DIR, "openwisp-controller.db"),
1717
}
1818
}
19+
if TESTING and "--exclude-tag=selenium_tests" not in sys.argv:
20+
DATABASES["default"]["TEST"] = {
21+
"NAME": os.path.join(BASE_DIR, "openwisp-controller-test.db"),
22+
}
1923

2024
SPATIALITE_LIBRARY_PATH = "mod_spatialite.so"
2125

0 commit comments

Comments
 (0)