Skip to content

Commit

Permalink
[deps] Added support for django 3.2 and 4.0 alpha #255
Browse files Browse the repository at this point in the history
Closes #255
  • Loading branch information
codesankalp authored Oct 15, 2021
1 parent 9e182fd commit 5c16402
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 14 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ jobs:
fail-fast: false
matrix:
python-version:
- 3.6
- 3.7
- 3.8
django-version:
- django~=2.2.0
- django~=3.0.0
- django~=3.1.0
- django~=3.2.0
include:
- django-version: django~=4.0a1
python-version: 3.8
experimental: true

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion openwisp_utils/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib.admin import ModelAdmin, StackedInline
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class TimeReadonlyAdminMixin(object):
Expand Down
4 changes: 2 additions & 2 deletions openwisp_utils/admin_theme/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.conf import settings
from django.contrib import admin
from django.utils.translation import ugettext_lazy
from django.utils.translation import gettext_lazy

from . import settings as app_settings
from .dashboard import get_dashboard_context
Expand All @@ -16,7 +16,7 @@ class OpenwispAdminSite(admin.AdminSite):
# h1 text
site_header = getattr(settings, 'OPENWISP_ADMIN_SITE_HEADER', 'OpenWISP')
# text at the top of the admin index page
index_title = ugettext_lazy(
index_title = gettext_lazy(
getattr(settings, 'OPENWISP_ADMIN_INDEX_TITLE', 'Network Administration')
)
enable_nav_sidebar = False
Expand Down
2 changes: 1 addition & 1 deletion openwisp_utils/admin_theme/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from . import settings as app_settings
from .checks import admin_theme_settings_checks
Expand Down
2 changes: 1 addition & 1 deletion openwisp_utils/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import uuid

from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from model_utils.fields import AutoCreatedField, AutoLastModifiedField
from openwisp_utils.utils import get_random_key
from openwisp_utils.validators import key_validator
Expand Down
2 changes: 1 addition & 1 deletion openwisp_utils/validators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.core.validators import RegexValidator, _lazy_re_compile
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

key_validator = RegexValidator(
_lazy_re_compile('^[^\\s/\\.]+$'),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib import admin
from django.contrib.auth.models import User
from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from openwisp_utils.admin import (
AlwaysHasChangedMixin,
HelpTextStackedInline,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/api/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.http import JsonResponse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.views import View

from ..models import Project
Expand Down
3 changes: 2 additions & 1 deletion tests/test_project/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.db.models import Case, Count, Sum, When
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from openwisp_utils.admin_theme import (
register_dashboard_chart,
register_dashboard_template,
Expand All @@ -18,6 +18,7 @@ class TestAppConfig(ApiAppConfig):
'DEFAULT_THROTTLE_RATES': {'test': '10/minute'},
'TEST': True,
}
default_auto_field = 'django.db.models.AutoField'

def ready(self, *args, **kwargs):
super().ready(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from openwisp_utils.base import KeyField, TimeStampedEditableModel, UUIDModel


Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create_dir(*paths: str):
and all the intermidiate ones according to the joined path using os.makedirs
"""
joined_path = os.path.join(*paths)
os.makedirs(joined_path)
os.makedirs(joined_path, exist_ok=True)
return joined_path


Expand Down
2 changes: 1 addition & 1 deletion tests/test_project/tests/test_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from ..models import Shelf

status_signal = Signal(providing_args=['status'])
status_signal = Signal() # providing_args=['status']


class TestUtils(TestCase):
Expand Down

0 comments on commit 5c16402

Please sign in to comment.