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
aff9b2f5
Kaydet (Commit)
aff9b2f5
authored
Eki 28, 2012
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #19203 -- Added isolation to a humanize test
Thanks lrekucki for the report.
üst
5fec97b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
global_settings.py
django/conf/global_settings.py
+1
-1
tests.py
django/contrib/humanize/tests.py
+10
-1
No files found.
django/conf/global_settings.py
Dosyayı görüntüle @
aff9b2f5
...
...
@@ -34,7 +34,7 @@ INTERNAL_IPS = ()
# systems may support all possibilities). When USE_TZ is True, this is
# interpreted as the default user time zone.
TIME_ZONE
=
'America/Chicago'
TIME_ZONE
=
'Europe/Paris'
# If you set this to True, Django will use timezone-aware datetimes.
USE_TZ
=
False
...
...
django/contrib/humanize/tests.py
Dosyayı görüntüle @
aff9b2f5
from
__future__
import
unicode_literals
import
datetime
try
:
import
pytz
except
ImportError
:
pytz
=
None
from
django.conf
import
settings
from
django.contrib.humanize.templatetags
import
humanize
from
django.template
import
Template
,
Context
,
defaultfilters
from
django.test
import
TestCase
...
...
@@ -10,6 +16,7 @@ from django.utils.timezone import utc
from
django.utils
import
translation
from
django.utils.translation
import
ugettext
as
_
from
django.utils
import
tzinfo
from
django.utils.unittest
import
skipIf
# Mock out datetime in some tests so they don't fail occasionally when they
...
...
@@ -141,6 +148,8 @@ class HumanizeTests(TestCase):
# As 24h of difference they will never be the same
self
.
assertNotEqual
(
naturalday_one
,
naturalday_two
)
@skipIf
(
settings
.
TIME_ZONE
!=
"Ameria/Chicago"
and
pytz
is
None
,
"this test requires pytz when a non-default time zone is set"
)
def
test_naturalday_uses_localtime
(
self
):
# Regression for #18504
# This is 2012-03-08HT19:30:00-06:00 in Ameria/Chicago
...
...
@@ -148,7 +157,7 @@ class HumanizeTests(TestCase):
orig_humanize_datetime
,
humanize
.
datetime
=
humanize
.
datetime
,
MockDateTime
try
:
with
override_settings
(
USE_TZ
=
True
):
with
override_settings
(
TIME_ZONE
=
"America/Chicago"
,
USE_TZ
=
True
):
self
.
humanize_tester
([
dt
],
[
'yesterday'
],
'naturalday'
)
finally
:
humanize
.
datetime
=
orig_humanize_datetime
...
...
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