Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
d15c61ca
Kaydet (Commit)
d15c61ca
authored
Ock 21, 2019
tarafından
Jon Dufresne
Kaydeden (comit)
Tim Graham
Ock 21, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #30121 -- Fixed assertURLEqual() crash with reverse_lazy() URLs.
Regression in
24959e48
.
üst
65858119
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
testcases.py
django/test/testcases.py
+1
-0
tests.py
tests/test_utils/tests.py
+3
-1
urls.py
tests/test_utils/urls.py
+1
-1
No files found.
django/test/testcases.py
Dosyayı görüntüle @
d15c61ca
...
@@ -393,6 +393,7 @@ class SimpleTestCase(unittest.TestCase):
...
@@ -393,6 +393,7 @@ class SimpleTestCase(unittest.TestCase):
"""
"""
def
normalize
(
url
):
def
normalize
(
url
):
"""Sort the URL's query string parameters."""
"""Sort the URL's query string parameters."""
url
=
str
(
url
)
# Coerce reverse_lazy() URLs.
scheme
,
netloc
,
path
,
params
,
query
,
fragment
=
urlparse
(
url
)
scheme
,
netloc
,
path
,
params
,
query
,
fragment
=
urlparse
(
url
)
query_parts
=
sorted
(
parse_qsl
(
query
))
query_parts
=
sorted
(
parse_qsl
(
query
))
return
urlunparse
((
scheme
,
netloc
,
path
,
params
,
urlencode
(
query_parts
),
fragment
))
return
urlunparse
((
scheme
,
netloc
,
path
,
params
,
urlencode
(
query_parts
),
fragment
))
...
...
tests/test_utils/tests.py
Dosyayı görüntüle @
d15c61ca
...
@@ -22,7 +22,7 @@ from django.test.utils import (
...
@@ -22,7 +22,7 @@ from django.test.utils import (
CaptureQueriesContext
,
TestContextDecorator
,
isolate_apps
,
CaptureQueriesContext
,
TestContextDecorator
,
isolate_apps
,
override_settings
,
setup_test_environment
,
override_settings
,
setup_test_environment
,
)
)
from
django.urls
import
NoReverseMatch
,
path
,
reverse
from
django.urls
import
NoReverseMatch
,
path
,
reverse
,
reverse_lazy
from
.models
import
Car
,
Person
,
PossessedCar
from
.models
import
Car
,
Person
,
PossessedCar
from
.views
import
empty_response
from
.views
import
empty_response
...
@@ -961,6 +961,7 @@ class AssertFieldOutputTests(SimpleTestCase):
...
@@ -961,6 +961,7 @@ class AssertFieldOutputTests(SimpleTestCase):
self
.
assertFieldOutput
(
MyCustomField
,
{},
{},
empty_value
=
None
)
self
.
assertFieldOutput
(
MyCustomField
,
{},
{},
empty_value
=
None
)
@override_settings
(
ROOT_URLCONF
=
'test_utils.urls'
)
class
AssertURLEqualTests
(
SimpleTestCase
):
class
AssertURLEqualTests
(
SimpleTestCase
):
def
test_equal
(
self
):
def
test_equal
(
self
):
valid_tests
=
(
valid_tests
=
(
...
@@ -971,6 +972,7 @@ class AssertURLEqualTests(SimpleTestCase):
...
@@ -971,6 +972,7 @@ class AssertURLEqualTests(SimpleTestCase):
(
'http://example.com/?x=1&y=2&a=1&a=2'
,
'http://example.com/?a=1&a=2&y=2&x=1'
),
(
'http://example.com/?x=1&y=2&a=1&a=2'
,
'http://example.com/?a=1&a=2&y=2&x=1'
),
(
'/path/to/?x=1&y=2&z=3'
,
'/path/to/?z=3&y=2&x=1'
),
(
'/path/to/?x=1&y=2&z=3'
,
'/path/to/?z=3&y=2&x=1'
),
(
'?x=1&y=2&z=3'
,
'?z=3&y=2&x=1'
),
(
'?x=1&y=2&z=3'
,
'?z=3&y=2&x=1'
),
(
'/test_utils/no_template_used/'
,
reverse_lazy
(
'no_template_used'
)),
)
)
for
url1
,
url2
in
valid_tests
:
for
url1
,
url2
in
valid_tests
:
with
self
.
subTest
(
url
=
url1
):
with
self
.
subTest
(
url
=
url1
):
...
...
tests/test_utils/urls.py
Dosyayı görüntüle @
d15c61ca
...
@@ -4,5 +4,5 @@ from . import views
...
@@ -4,5 +4,5 @@ from . import views
urlpatterns
=
[
urlpatterns
=
[
path
(
'test_utils/get_person/<int:pk>/'
,
views
.
get_person
),
path
(
'test_utils/get_person/<int:pk>/'
,
views
.
get_person
),
path
(
'test_utils/no_template_used/'
,
views
.
no_template_used
),
path
(
'test_utils/no_template_used/'
,
views
.
no_template_used
,
name
=
'no_template_used'
),
]
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment