summaryrefslogtreecommitdiff
path: root/tests/test_utils
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-12-07 17:52:28 -0500
committerTim Graham <timograham@gmail.com>2018-12-31 10:47:32 -0500
commit043bd709425149b8eff3fb821cba5c23aaebd0df (patch)
tree7624be405a6a6e5a041e2852251ef76e9d28fa7d /tests/test_utils
parent1136d57f01ce3e3efab44163ccd7b3b34ec4207f (diff)
Updated test URL patterns to use path() and re_path().
Diffstat (limited to 'tests/test_utils')
-rw-r--r--tests/test_utils/tests.py7
-rw-r--r--tests/test_utils/urls.py6
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index 320531e32c..e9aa9d9c98 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -5,7 +5,6 @@ from io import StringIO
from unittest import mock
from django.conf import settings
-from django.conf.urls import url
from django.contrib.staticfiles.finders import get_finder, get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.storage import default_storage
@@ -22,7 +21,7 @@ from django.test.utils import (
CaptureQueriesContext, TestContextDecorator, isolate_apps,
override_settings, setup_test_environment,
)
-from django.urls import NoReverseMatch, reverse
+from django.urls import NoReverseMatch, path, reverse
from .models import Car, Person, PossessedCar
from .views import empty_response
@@ -962,11 +961,11 @@ class AssertURLEqualTests(SimpleTestCase):
class FirstUrls:
- urlpatterns = [url(r'first/$', empty_response, name='first')]
+ urlpatterns = [path('first/', empty_response, name='first')]
class SecondUrls:
- urlpatterns = [url(r'second/$', empty_response, name='second')]
+ urlpatterns = [path('second/', empty_response, name='second')]
class SetupTestEnvironmentTests(SimpleTestCase):
diff --git a/tests/test_utils/urls.py b/tests/test_utils/urls.py
index a886451721..5cfab5d831 100644
--- a/tests/test_utils/urls.py
+++ b/tests/test_utils/urls.py
@@ -1,8 +1,8 @@
-from django.conf.urls import url
+from django.urls import path
from . import views
urlpatterns = [
- url(r'^test_utils/get_person/([0-9]+)/$', views.get_person),
- url(r'^test_utils/no_template_used/$', views.no_template_used),
+ path('test_utils/get_person/<int:pk>/', views.get_person),
+ path('test_utils/no_template_used/', views.no_template_used),
]