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
f8a634af
Kaydet (Commit)
f8a634af
authored
Mar 11, 2013
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed tests that relied on MANAGERS not being empty.
Regression in
d0561242
.
üst
94521f50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
tests.py
tests/middleware/tests.py
+10
-4
No files found.
tests/middleware/tests.py
Dosyayı görüntüle @
f8a634af
...
...
@@ -245,7 +245,8 @@ class CommonMiddlewareTest(TestCase):
# Legacy tests for the 404 error reporting via email (to be removed in 1.8)
@override_settings
(
IGNORABLE_404_URLS
=
(
re
.
compile
(
r'foo'
),),
SEND_BROKEN_LINK_EMAILS
=
True
)
SEND_BROKEN_LINK_EMAILS
=
True
,
MANAGERS
=
(
'PHB@dilbert.com'
,))
def
test_404_error_reporting
(
self
):
request
=
self
.
_get_request
(
'regular_url/that/does/not/exist'
)
request
.
META
[
'HTTP_REFERER'
]
=
'/another/url/'
...
...
@@ -257,7 +258,8 @@ class CommonMiddlewareTest(TestCase):
self
.
assertIn
(
'Broken'
,
mail
.
outbox
[
0
]
.
subject
)
@override_settings
(
IGNORABLE_404_URLS
=
(
re
.
compile
(
r'foo'
),),
SEND_BROKEN_LINK_EMAILS
=
True
)
SEND_BROKEN_LINK_EMAILS
=
True
,
MANAGERS
=
(
'PHB@dilbert.com'
,))
def
test_404_error_reporting_no_referer
(
self
):
request
=
self
.
_get_request
(
'regular_url/that/does/not/exist'
)
with
warnings
.
catch_warnings
():
...
...
@@ -267,7 +269,8 @@ class CommonMiddlewareTest(TestCase):
self
.
assertEqual
(
len
(
mail
.
outbox
),
0
)
@override_settings
(
IGNORABLE_404_URLS
=
(
re
.
compile
(
r'foo'
),),
SEND_BROKEN_LINK_EMAILS
=
True
)
SEND_BROKEN_LINK_EMAILS
=
True
,
MANAGERS
=
(
'PHB@dilbert.com'
,))
def
test_404_error_reporting_ignored_url
(
self
):
request
=
self
.
_get_request
(
'foo_url/that/does/not/exist/either'
)
request
.
META
[
'HTTP_REFERER'
]
=
'/another/url/'
...
...
@@ -287,7 +290,10 @@ class CommonMiddlewareTest(TestCase):
self
.
assertEqual
(
response
.
status_code
,
301
)
@override_settings
(
IGNORABLE_404_URLS
=
(
re
.
compile
(
r'foo'
),))
@override_settings
(
IGNORABLE_404_URLS
=
(
re
.
compile
(
r'foo'
),),
MANAGERS
=
(
'PHB@dilbert.com'
,),
)
class
BrokenLinkEmailsMiddlewareTest
(
TestCase
):
def
setUp
(
self
):
...
...
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