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
4bb70cbc
Kaydet (Commit)
4bb70cbc
authored
Kas 10, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed an obsolete (as of refs #25999) logging test from refs #18985.
üst
88586314
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
31 deletions
+0
-31
tests.py
tests/logging_tests/tests.py
+0
-31
No files found.
tests/logging_tests/tests.py
Dosyayı görüntüle @
4bb70cbc
...
...
@@ -2,7 +2,6 @@
from
__future__
import
unicode_literals
import
logging
import
warnings
from
contextlib
import
contextmanager
from
admin_scripts.tests
import
AdminScriptTestCase
...
...
@@ -15,7 +14,6 @@ from django.db import connection
from
django.test
import
RequestFactory
,
SimpleTestCase
,
override_settings
from
django.test.utils
import
LoggingCaptureMixin
,
patch_logger
from
django.utils
import
six
from
django.utils.deprecation
import
RemovedInNextVersionWarning
from
django.utils.log
import
(
DEFAULT_LOGGING
,
AdminEmailHandler
,
CallbackFilter
,
RequireDebugFalse
,
RequireDebugTrue
,
ServerFormatter
,
...
...
@@ -147,35 +145,6 @@ class I18nLoggingTests(SetupDefaultLoggingMixin, LoggingCaptureMixin, SimpleTest
self
.
assertEqual
(
self
.
logger_output
.
getvalue
(),
'Not Found: /this_does_not/
\n
Not Found: /en/nor_this/
\n
'
)
class
WarningLoggerTests
(
SimpleTestCase
):
"""
Tests that warnings output for RemovedInDjangoXXWarning (XX being the next
Django version) is enabled and captured to the logging system
"""
def
setUp
(
self
):
# If tests are invoke with "-Wall" (or any -W flag actually) then
# warning logging gets disabled (see configure_logging in django/utils/log.py).
# However, these tests expect warnings to be logged, so manually force warnings
# to the logs. Use getattr() here because the logging capture state is
# undocumented and (I assume) brittle.
self
.
_old_capture_state
=
bool
(
getattr
(
logging
,
'_warnings_showwarning'
,
False
))
logging
.
captureWarnings
(
True
)
def
tearDown
(
self
):
# Reset warnings state.
logging
.
captureWarnings
(
self
.
_old_capture_state
)
@override_settings
(
DEBUG
=
True
)
def
test_error_filter_still_raises
(
self
):
with
warnings
.
catch_warnings
():
warnings
.
filterwarnings
(
'error'
,
category
=
RemovedInNextVersionWarning
)
with
self
.
assertRaises
(
RemovedInNextVersionWarning
):
warnings
.
warn
(
'Foo Deprecated'
,
RemovedInNextVersionWarning
)
class
CallbackFilterTest
(
SimpleTestCase
):
def
test_sense
(
self
):
f_false
=
CallbackFilter
(
lambda
r
:
False
)
...
...
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