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
0cbfc844
Kaydet (Commit)
0cbfc844
authored
Ock 27, 2017
tarafından
Anton Samarchyan
Kaydeden (comit)
Tim Graham
Ock 27, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improved test coverage and error messages for conf.urls.__init__.
üst
e07e743e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
__init__.py
django/conf/urls/__init__.py
+4
-3
tests.py
tests/urlpatterns_reverse/tests.py
+10
-0
No files found.
django/conf/urls/__init__.py
Dosyayı görüntüle @
0cbfc844
...
...
@@ -22,12 +22,13 @@ def include(arg, namespace=None):
except
ValueError
:
if
namespace
:
raise
ImproperlyConfigured
(
'Cannot override the namespace for a dynamic module that provides a namespace'
'Cannot override the namespace for a dynamic module that '
'provides a namespace.'
)
raise
ImproperlyConfigured
(
'Passing a
3
-tuple to django.conf.urls.include() is not supported. '
'Passing a
%
d
-tuple to django.conf.urls.include() is not supported. '
'Pass a 2-tuple containing the list of patterns and app_name, '
'and provide the namespace argument to include() instead.'
,
'and provide the namespace argument to include() instead.'
%
len
(
arg
)
)
else
:
# No namespace hint - use manually provided namespace
...
...
tests/urlpatterns_reverse/tests.py
Dosyayı görüntüle @
0cbfc844
...
...
@@ -1058,11 +1058,21 @@ class IncludeTests(SimpleTestCase):
with
self
.
assertRaisesMessage
(
ImproperlyConfigured
,
msg
):
include
(
self
.
url_patterns
,
'namespace'
)
def
test_include_4_tuple
(
self
):
msg
=
'Passing a 4-tuple to django.conf.urls.include() is not supported.'
with
self
.
assertRaisesMessage
(
ImproperlyConfigured
,
msg
):
include
((
self
.
url_patterns
,
'app_name'
,
'namespace'
,
'blah'
))
def
test_include_3_tuple
(
self
):
msg
=
'Passing a 3-tuple to django.conf.urls.include() is not supported.'
with
self
.
assertRaisesMessage
(
ImproperlyConfigured
,
msg
):
include
((
self
.
url_patterns
,
'app_name'
,
'namespace'
))
def
test_include_3_tuple_namespace
(
self
):
msg
=
'Cannot override the namespace for a dynamic module that provides a namespace.'
with
self
.
assertRaisesMessage
(
ImproperlyConfigured
,
msg
):
include
((
self
.
url_patterns
,
'app_name'
,
'namespace'
),
'namespace'
)
def
test_include_2_tuple
(
self
):
self
.
assertEqual
(
include
((
self
.
url_patterns
,
'app_name'
)),
...
...
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