Skip to content

Commit

Permalink
Fix Django 4.0 4.1 deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
charleszlu committed Nov 9, 2021
1 parent faa4cd8 commit 63f08cb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'tests',
],
MIDDLEWARE_CLASSES=[],
ROOT_URLCONF='taggit_selectize.urls',
)


Expand Down
4 changes: 2 additions & 2 deletions taggit_selectize/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.conf.urls import *
from django.urls import path

from .views import get_tags_recommendation

urlpatterns = [
url(r'^$', get_tags_recommendation, name='tags_recommendation'),
path('', get_tags_recommendation, name='tags_recommendation'),
]
4 changes: 2 additions & 2 deletions taggit_selectize/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Miscellaneous utilities
import six
from django.utils.encoding import force_text
from django.utils.encoding import force_str
from taggit.utils import split_strip
from .conf import settings

Expand All @@ -20,7 +20,7 @@ def parse_tags(tagstring):
if not tagstring:
return []

tagstring = force_text(tagstring)
tagstring = force_str(tagstring)

words = []
buffer = []
Expand Down
9 changes: 9 additions & 0 deletions tests/test_urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.test import TestCase
from django.urls import reverse


class TestUrls(TestCase):
def test_urls(self):
response = self.client.get(reverse('tags_recommendation'))
self.assertEqual(response.status_code, 200)
self.assertEqual(response.request['PATH_INFO'], '/')

0 comments on commit 63f08cb

Please sign in to comment.