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
412997f8
Kaydet (Commit)
412997f8
authored
Ara 15, 2016
tarafından
Tim Graham
Kaydeden (comit)
GitHub
Ara 15, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Used assertRaisesMessage() in template_backends tests.
üst
e36a9d3f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
test_utils.py
tests/template_backends/test_utils.py
+16
-15
No files found.
tests/template_backends/test_utils.py
Dosyayı görüntüle @
412997f8
...
...
@@ -3,20 +3,17 @@ from django.template import engines
from
django.test
import
SimpleTestCase
,
override_settings
class
Template
String
sTests
(
SimpleTestCase
):
class
Template
Util
sTests
(
SimpleTestCase
):
@override_settings
(
TEMPLATES
=
[{
'BACKEND'
:
'raise.import.error'
,
}])
@override_settings
(
TEMPLATES
=
[{
'BACKEND'
:
'raise.import.error'
}])
def
test_backend_import_error
(
self
):
"""
Failing to import a backend keeps raising the original import error.
Regression test for #24265.
Failing to import a backend keeps raising the original import error
(#24265).
"""
with
self
.
assertRaises
(
ImportError
):
with
self
.
assertRaises
Regex
(
ImportError
,
"No module named '?raise"
):
engines
.
all
()
with
self
.
assertRaises
(
ImportError
):
with
self
.
assertRaises
Regex
(
ImportError
,
"No module named '?raise"
):
engines
.
all
()
@override_settings
(
TEMPLATES
=
[{
...
...
@@ -27,13 +24,13 @@ class TemplateStringsTests(SimpleTestCase):
}])
def
test_backend_improperly_configured
(
self
):
"""
Failing to initialize a backend keeps raising the original exception.
Regression test for #24265.
Failing to initialize a backend keeps raising the original exception
(#24265).
"""
with
self
.
assertRaises
(
ImproperlyConfigured
):
msg
=
'app_dirs must not be set when loaders is defined.'
with
self
.
assertRaisesMessage
(
ImproperlyConfigured
,
msg
):
engines
.
all
()
with
self
.
assertRaises
(
ImproperlyConfigured
):
with
self
.
assertRaises
Message
(
ImproperlyConfigured
,
msg
):
engines
.
all
()
@override_settings
(
TEMPLATES
=
[{
...
...
@@ -42,5 +39,9 @@ class TemplateStringsTests(SimpleTestCase):
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
}])
def
test_backend_names_must_be_unique
(
self
):
with
self
.
assertRaises
(
ImproperlyConfigured
):
msg
=
(
"Template engine aliases aren't unique, duplicates: django. Set "
"a unique NAME for each engine in settings.TEMPLATES."
)
with
self
.
assertRaisesMessage
(
ImproperlyConfigured
,
msg
):
engines
.
all
()
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