From fee42fd99ee470528858c2ccb3621135c30ec262 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 26 Jan 2017 14:25:15 +0100 Subject: Refs #23919 -- Replaced usage of django.utils.http utilities with Python equivalents Thanks Tim Graham for the review. --- tests/contenttypes_tests/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/contenttypes_tests') diff --git a/tests/contenttypes_tests/models.py b/tests/contenttypes_tests/models.py index 0aa8bbf0bc..5475c4aade 100644 --- a/tests/contenttypes_tests/models.py +++ b/tests/contenttypes_tests/models.py @@ -1,10 +1,11 @@ +from urllib.parse import quote + from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import SiteManager from django.db import models -from django.utils.http import urlquote class Site(models.Model): @@ -72,7 +73,7 @@ class FooWithUrl(FooWithoutUrl): """ def get_absolute_url(self): - return "/users/%s/" % urlquote(self.name) + return "/users/%s/" % quote(self.name) class FooWithBrokenAbsoluteUrl(FooWithoutUrl): @@ -126,4 +127,4 @@ class ModelWithNullFKToSite(models.Model): return self.title def get_absolute_url(self): - return '/title/%s/' % urlquote(self.title) + return '/title/%s/' % quote(self.title) -- cgit v1.3