Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions django_object_actions/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
"""
from django.contrib.admin.utils import quote
from django.http import HttpResponse
from django.urls import reverse
from unittest.mock import patch

try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse # < DJANGO1.10

from .tests import LoggedInTestCase
from example_project.polls.factories import (
CommentFactory,
Expand Down
5 changes: 1 addition & 4 deletions django_object_actions/tests/test_urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"""
Integration tests
"""
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse # < DJANGO1.10
from django.urls import reverse

from .tests import LoggedInTestCase

Expand Down
5 changes: 1 addition & 4 deletions django_object_actions/tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse # < DJANGO1.10
from django.urls import reverse
from django.test import TestCase

from example_project.polls.factories import UserFactory
Expand Down
11 changes: 1 addition & 10 deletions django_object_actions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from django.views.generic.list import MultipleObjectMixin

try:
from django.urls import re_path
except ImportError:
from django.conf.urls import url as re_path # DJANGO1.11

try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse # DJANGO1.10
from django.urls import re_path, reverse


class BaseDjangoObjectActions(object):
Expand Down
6 changes: 1 addition & 5 deletions example_project/polls/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
from django.contrib.admin import AdminSite
from django.db.models import F
from django.http import HttpResponseRedirect

try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse # < DJANGO1.10
from django.urls import reverse

from django_object_actions import DjangoObjectActions, takes_instance_or_queryset

Expand Down
14 changes: 3 additions & 11 deletions example_project/urls.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
from django import VERSION
from django.conf.urls import url
from django.urls import include, path
from django.contrib import admin
from example_project.polls.admin import support_admin

if VERSION[0] == 1 and VERSION[1] <= 8:
from django.conf.urls import include
else:
# DJANGO1.9
# https://docs.djangoproject.com/en/2.0/releases/1.9/#passing-a-3-tuple-or-an-app-name-to-include
def include(urls):
return urls


urlpatterns = [
url(r"^admin/", include(admin.site.urls)),
url(r"^support/", include(support_admin.urls)),
Comment on lines -16 to -17
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The url() function is deprecated and will be dropped in Django 4. This would be displayed while running test with warning enabled (-Wall)

path("admin/", admin.site.urls),
path("support/", support_admin.urls),
]