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
8b874730
Kaydet (Commit)
8b874730
authored
May 17, 2014
tarafından
Alex Gaynor
Kaydeden (comit)
Tim Graham
May 17, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[1.7.x] Fixed several flake8 errors, including one where a test wouldn't be run
Backport of
b6b873d2
from master
üst
bc2bfbad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
timezone.py
django/utils/timezone.py
+1
-1
test_timezone.py
tests/utils_tests/test_timezone.py
+1
-1
No files found.
django/utils/timezone.py
Dosyayı görüntüle @
8b874730
...
@@ -360,7 +360,7 @@ def make_aware(value, timezone):
...
@@ -360,7 +360,7 @@ def make_aware(value, timezone):
# Check that we won't overwrite the timezone of an aware datetime.
# Check that we won't overwrite the timezone of an aware datetime.
if
is_aware
(
value
):
if
is_aware
(
value
):
raise
ValueError
(
raise
ValueError
(
"make_aware expects a naive datetime, got
%
s"
%
value
)
"make_aware expects a naive datetime, got
%
s"
%
value
)
# This may be wrong around DST changes!
# This may be wrong around DST changes!
return
value
.
replace
(
tzinfo
=
timezone
)
return
value
.
replace
(
tzinfo
=
timezone
)
...
...
tests/utils_tests/test_timezone.py
Dosyayı görüntüle @
8b874730
...
@@ -109,7 +109,7 @@ class TimezoneTests(unittest.TestCase):
...
@@ -109,7 +109,7 @@ class TimezoneTests(unittest.TestCase):
timezone
.
make_naive
(
datetime
.
datetime
(
2011
,
9
,
1
,
13
,
20
,
30
),
EAT
)
timezone
.
make_naive
(
datetime
.
datetime
(
2011
,
9
,
1
,
13
,
20
,
30
),
EAT
)
@unittest.skipIf
(
pytz
is
None
,
"this test requires pytz"
)
@unittest.skipIf
(
pytz
is
None
,
"this test requires pytz"
)
def
test_make_aware
(
self
):
def
test_make_aware
2
(
self
):
self
.
assertEqual
(
self
.
assertEqual
(
timezone
.
make_aware
(
datetime
.
datetime
(
2011
,
9
,
1
,
12
,
20
,
30
),
CET
),
timezone
.
make_aware
(
datetime
.
datetime
(
2011
,
9
,
1
,
12
,
20
,
30
),
CET
),
CET
.
localize
(
datetime
.
datetime
(
2011
,
9
,
1
,
12
,
20
,
30
)))
CET
.
localize
(
datetime
.
datetime
(
2011
,
9
,
1
,
12
,
20
,
30
)))
...
...
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