Skip to content

Commit b8169d9

Browse files
pandafynemesifier
authored andcommitted
[deps] Added support for Django 4.1.0 and Django 4.2.0
- Dropped support for Python 3.7 - Dropped support for Django 4.0.0 - Bumped django-reversion~=5.0.4 - Bumped django-taggit~=4.0.0 - Bumped paramiko[ed25519]~=3.2.0 - Bumped django-import-export~=3.2.0 - [tests] Fixed selenium tests - [fix] Fixed CSS for jsonschema UI - [fix] Fixed flaky test_create_new_device test
1 parent 6adafe3 commit b8169d9

File tree

36 files changed

+110
-74
lines changed

36 files changed

+110
-74
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
ports:
2323
- 6379:6379
2424
postgres:
25-
image: mdillon/postgis:11-alpine
25+
image: postgis/postgis:13-3.3-alpine
2626
env:
2727
POSTGRES_PASSWORD: openwisp2
2828
POSTGRES_USER: openwisp2
@@ -39,10 +39,8 @@ jobs:
3939
- "3.10"
4040
django-version:
4141
- django~=3.2.0
42-
- django~=4.0.0
43-
include:
44-
- django-version: django~=3.2.0
45-
python-version: 3.7
42+
- django~=4.1.0
43+
- django~=4.2.0
4644

4745
steps:
4846
- uses: actions/checkout@v2
@@ -67,13 +65,13 @@ jobs:
6765
- name: Upgrade python system packages
6866
run: pip install -U pip wheel setuptools
6967

70-
- name: Install openwisp-controller
71-
run: |
72-
pip install -e .
73-
7468
- name: Install test dependencies
7569
run: |
7670
pip install -U -r requirements-test.txt
71+
72+
- name: Install openwisp-controller
73+
run: |
74+
pip install -U -e .
7775
pip install ${{ matrix.django-version }}
7876
7977
- name: QA checks
@@ -82,9 +80,11 @@ jobs:
8280
- name: Tests
8381
run: |
8482
coverage run runtests.py --parallel
83+
# the following command runs tests with Postgres/PostGIS but
84+
# only for specific test cases which are tagged with "db_tests"
8585
POSTGRESQL=1 coverage run runtests.py --parallel --keepdb
8686
coverage combine
87-
# SAMPLE tests
87+
# tests the extension capability
8888
SAMPLE_APP=1 ./runtests.py --keepdb
8989
env:
9090
SELENIUM_HEADLESS: 1

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ services:
2121
entrypoint: redis-server --appendonly yes
2222

2323
postgres:
24-
image: mdillon/postgis:11-alpine
24+
image: postgis/postgis:13-3.3-alpine
2525
environment:
2626
POSTGRES_PASSWORD: openwisp2
2727
POSTGRES_USER: openwisp2
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'openwisp_controller.config.apps.ConfigConfig'

openwisp_controller/config/migrations/0030_django_taggit_update.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class Migration(migrations.Migration):
3535
migrations.AlterField(
3636
model_name='templatetag',
3737
name='slug',
38-
field=models.SlugField(max_length=100, unique=True, verbose_name='slug'),
38+
field=models.SlugField(
39+
allow_unicode=True, max_length=100, unique=True, verbose_name='slug'
40+
),
3941
),
4042
]

openwisp_controller/config/static/config/css/lib/advanced-mode.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,9 @@ table.jsoneditor-search button.jsoneditor-previous:hover {
857857
#main .property-selector .form-row {
858858
padding: 5px 0 6px 10px !important;
859859
}
860+
#main .property-selector {
861+
text-align: left;
862+
}
860863
@media (max-width: 768px){
861864
.jsoneditor-menu #netjsonconfig-hint-advancedmode{
862865
display: none;

openwisp_controller/config/static/config/js/widget.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ JSONEditor.defaults.themes.django = JSONEditor.AbstractTheme.extend({
543543
},
544544
getCheckbox: function () {
545545
var el = this.getFormInputField('checkbox');
546+
el.className = null;
546547
el.style.display = 'inline-block';
547548
el.style.width = 'auto';
548549
return el;

openwisp_controller/config/tests/test_selenium.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
2+
from django.test import tag
23
from django.urls.base import reverse
34
from selenium.common.exceptions import (
45
StaleElementReferenceException,
@@ -16,6 +17,7 @@
1617
from .utils import CreateConfigTemplateMixin
1718

1819

20+
@tag('selenium_tests')
1921
class TestDeviceAdmin(
2022
TestOrganizationMixin,
2123
CreateConfigTemplateMixin,
@@ -84,7 +86,7 @@ def test_create_new_device(self):
8486

8587
try:
8688
WebDriverWait(self.web_driver, 2).until(
87-
EC.element_to_be_clickable(
89+
EC.presence_of_element_located(
8890
(By.XPATH, f'//*[@value="{default_template.id}"]')
8991
)
9092
)

openwisp_controller/config/tests/test_template.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from openwisp_users.tests.utils import TestOrganizationMixin
1313
from openwisp_utils.tests import catch_signal
1414

15+
from ...tests.utils import TransactionTestMixin
1516
from .. import settings as app_settings
1617
from ..signals import config_modified, config_status_changed
1718
from ..tasks import logger as task_logger
@@ -504,6 +505,7 @@ def test_required_vpn_template_corner_case(self):
504505

505506

506507
class TestTemplateTransaction(
508+
TransactionTestMixin,
507509
TestOrganizationMixin,
508510
CreateConfigTemplateMixin,
509511
TestVpnX509Mixin,
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'openwisp_controller.connection.apps.ConnectionConfig'

openwisp_controller/connection/tests/test_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from openwisp_utils.tests import capture_any_output, catch_signal
1313

14+
from ...tests.utils import TransactionTestMixin
1415
from .. import settings as app_settings
1516
from ..apps import _TASK_NAME
1617
from ..commands import (
@@ -835,7 +836,7 @@ def test_command_multiple_connections(self, connect_mocked):
835836
self.assertIn(command.connection, [dc1, dc2])
836837

837838

838-
class TestModelsTransaction(BaseTestModels, TransactionTestCase):
839+
class TestModelsTransaction(TransactionTestMixin, BaseTestModels, TransactionTestCase):
839840
def _prepare_conf_object(self, organization=None):
840841
if not organization:
841842
organization = self._create_org(name='org1')

0 commit comments

Comments
 (0)