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
ce76fbfc
Kaydet (Commit)
ce76fbfc
authored
Mar 10, 2013
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #20019 -- Ensured HttpRequest.resolver_match always exists.
Obviously it isn't set until the URL is resolved.
üst
7fca4416
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
request.py
django/http/request.py
+1
-0
tests.py
tests/urlpatterns_reverse/tests.py
+5
-1
No files found.
django/http/request.py
Dosyayı görüntüle @
ce76fbfc
...
@@ -44,6 +44,7 @@ class HttpRequest(object):
...
@@ -44,6 +44,7 @@ class HttpRequest(object):
self
.
path
=
''
self
.
path
=
''
self
.
path_info
=
''
self
.
path_info
=
''
self
.
method
=
None
self
.
method
=
None
self
.
resolver_match
=
None
self
.
_post_parse_error
=
False
self
.
_post_parse_error
=
False
def
__repr__
(
self
):
def
__repr__
(
self
):
...
...
tests/urlpatterns_reverse/tests.py
Dosyayı görüntüle @
ce76fbfc
...
@@ -9,7 +9,7 @@ from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
...
@@ -9,7 +9,7 @@ from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from
django.core.urlresolvers
import
(
reverse
,
resolve
,
get_callable
,
from
django.core.urlresolvers
import
(
reverse
,
resolve
,
get_callable
,
get_resolver
,
NoReverseMatch
,
Resolver404
,
ResolverMatch
,
RegexURLResolver
,
get_resolver
,
NoReverseMatch
,
Resolver404
,
ResolverMatch
,
RegexURLResolver
,
RegexURLPattern
)
RegexURLPattern
)
from
django.http
import
HttpResponseRedirect
,
HttpResponsePermanentRedirect
from
django.http
import
HttpRe
quest
,
HttpRe
sponseRedirect
,
HttpResponsePermanentRedirect
from
django.shortcuts
import
redirect
from
django.shortcuts
import
redirect
from
django.test
import
TestCase
from
django.test
import
TestCase
from
django.utils
import
unittest
,
six
from
django.utils
import
unittest
,
six
...
@@ -529,6 +529,10 @@ class ResolverMatchTests(TestCase):
...
@@ -529,6 +529,10 @@ class ResolverMatchTests(TestCase):
resolver_match
=
response
.
resolver_match
resolver_match
=
response
.
resolver_match
self
.
assertEqual
(
resolver_match
.
url_name
,
'test-resolver-match'
)
self
.
assertEqual
(
resolver_match
.
url_name
,
'test-resolver-match'
)
def
test_resolver_match_on_request_before_resolution
(
self
):
request
=
HttpRequest
()
self
.
assertIsNone
(
request
.
resolver_match
)
class
ErroneousViewTests
(
TestCase
):
class
ErroneousViewTests
(
TestCase
):
urls
=
'urlpatterns_reverse.erroneous_urls'
urls
=
'urlpatterns_reverse.erroneous_urls'
...
...
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