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
e71b63e2
Kaydet (Commit)
e71b63e2
authored
Haz 04, 2013
tarafından
Ramiro Morales
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added i18n-related URL mapper test for a mailing list report.
üst
687afdaa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
tests.py
tests/i18n/patterns/tests.py
+3
-1
default.py
tests/i18n/patterns/urls/default.py
+1
-0
included.py
tests/i18n/patterns/urls/included.py
+9
-0
No files found.
tests/i18n/patterns/tests.py
Dosyayı görüntüle @
e71b63e2
...
@@ -52,8 +52,10 @@ class URLPrefixTests(URLTestCaseBase):
...
@@ -52,8 +52,10 @@ class URLPrefixTests(URLTestCaseBase):
def
test_not_prefixed
(
self
):
def
test_not_prefixed
(
self
):
with
translation
.
override
(
'en'
):
with
translation
.
override
(
'en'
):
self
.
assertEqual
(
reverse
(
'not-prefixed'
),
'/not-prefixed/'
)
self
.
assertEqual
(
reverse
(
'not-prefixed'
),
'/not-prefixed/'
)
self
.
assertEqual
(
reverse
(
'not-prefixed-included-url'
),
'/not-prefixed-include/foo/'
)
with
translation
.
override
(
'nl'
):
with
translation
.
override
(
'nl'
):
self
.
assertEqual
(
reverse
(
'not-prefixed'
),
'/not-prefixed/'
)
self
.
assertEqual
(
reverse
(
'not-prefixed'
),
'/not-prefixed/'
)
self
.
assertEqual
(
reverse
(
'not-prefixed-included-url'
),
'/not-prefixed-include/foo/'
)
def
test_prefixed
(
self
):
def
test_prefixed
(
self
):
with
translation
.
override
(
'en'
):
with
translation
.
override
(
'en'
):
...
@@ -183,7 +185,7 @@ class URLRedirectTests(URLTestCaseBase):
...
@@ -183,7 +185,7 @@ class URLRedirectTests(URLTestCaseBase):
class
URLVaryAcceptLanguageTests
(
URLTestCaseBase
):
class
URLVaryAcceptLanguageTests
(
URLTestCaseBase
):
"""
"""
Tests that 'Accept-Language' is not added to the Vary header when using
Tests that 'Accept-Language' is not added to the Vary header when using
prefixed URLs.
prefixed URLs.
"""
"""
def
test_no_prefix_response
(
self
):
def
test_no_prefix_response
(
self
):
response
=
self
.
client
.
get
(
'/not-prefixed/'
)
response
=
self
.
client
.
get
(
'/not-prefixed/'
)
...
...
tests/i18n/patterns/urls/default.py
Dosyayı görüntüle @
e71b63e2
...
@@ -8,6 +8,7 @@ view = TemplateView.as_view(template_name='dummy.html')
...
@@ -8,6 +8,7 @@ view = TemplateView.as_view(template_name='dummy.html')
urlpatterns
=
patterns
(
''
,
urlpatterns
=
patterns
(
''
,
url
(
r'^not-prefixed/$'
,
view
,
name
=
'not-prefixed'
),
url
(
r'^not-prefixed/$'
,
view
,
name
=
'not-prefixed'
),
url
(
r'^not-prefixed-include/'
,
include
(
'i18n.patterns.urls.included'
)),
url
(
_
(
r'^translated/$'
),
view
,
name
=
'no-prefix-translated'
),
url
(
_
(
r'^translated/$'
),
view
,
name
=
'no-prefix-translated'
),
url
(
_
(
r'^translated/(?P<slug>[\w-]+)/$'
),
view
,
name
=
'no-prefix-translated-slug'
),
url
(
_
(
r'^translated/(?P<slug>[\w-]+)/$'
),
view
,
name
=
'no-prefix-translated-slug'
),
)
)
...
...
tests/i18n/patterns/urls/included.py
0 → 100644
Dosyayı görüntüle @
e71b63e2
from
django.conf.urls
import
patterns
,
url
from
django.views.generic
import
TemplateView
view
=
TemplateView
.
as_view
(
template_name
=
'dummy.html'
)
urlpatterns
=
patterns
(
''
,
url
(
r'^foo/$'
,
view
,
name
=
'not-prefixed-included-url'
),
)
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