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
bab9c093
Kaydet (Commit)
bab9c093
authored
Eki 21, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed spelling of "unpicklable" in cache tests.
üst
32cd7069
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
tests.py
tests/cache/tests.py
+7
-8
No files found.
tests/cache/tests.py
Dosyayı görüntüle @
bab9c093
...
...
@@ -60,7 +60,7 @@ class C:
return
24
class
Unpickable
(
object
):
class
Unpick
l
able
(
object
):
def
__getstate__
(
self
):
raise
pickle
.
PickleError
()
...
...
@@ -849,7 +849,7 @@ class BaseCacheTests(object):
self
.
assertEqual
(
caches
[
'custom_key'
]
.
get
(
'answer2'
),
42
)
self
.
assertEqual
(
caches
[
'custom_key2'
]
.
get
(
'answer2'
),
42
)
def
test_cache_write_unpickable_object
(
self
):
def
test_cache_write_unpick
l
able_object
(
self
):
update_middleware
=
UpdateCacheMiddleware
()
update_middleware
.
cache
=
cache
...
...
@@ -880,14 +880,13 @@ class BaseCacheTests(object):
self
.
assertEqual
(
get_cache_data
.
cookies
,
response
.
cookies
)
def
test_add_fail_on_pickleerror
(
self
):
"See https://code.djangoproject.com/ticket/21200"
# Shouldn't fail silently if trying to cache an unpicklable type.
with
self
.
assertRaises
(
pickle
.
PickleError
):
cache
.
add
(
'unpick
able'
,
Unpick
able
())
cache
.
add
(
'unpick
lable'
,
Unpickl
able
())
def
test_set_fail_on_pickleerror
(
self
):
"See https://code.djangoproject.com/ticket/21200"
with
self
.
assertRaises
(
pickle
.
PickleError
):
cache
.
set
(
'unpick
able'
,
Unpick
able
())
cache
.
set
(
'unpick
lable'
,
Unpickl
able
())
def
test_get_or_set
(
self
):
self
.
assertIsNone
(
cache
.
get
(
'projector'
))
...
...
@@ -1226,9 +1225,9 @@ class FileBasedCacheTests(BaseCacheTests, TestCase):
cache
.
set
(
'foo'
,
'bar'
)
os
.
path
.
exists
(
self
.
dirname
)
def
test_cache_write_unpickable_type
(
self
):
def
test_cache_write_unpick
l
able_type
(
self
):
# This fails if not using the highest pickling protocol on Python 2.
cache
.
set
(
'unpickable'
,
UnpicklableType
())
cache
.
set
(
'unpick
l
able'
,
UnpicklableType
())
@override_settings
(
CACHES
=
{
...
...
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