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
ab7f4c33
Kaydet (Commit)
ab7f4c33
authored
Ara 30, 2017
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #28965 -- Deprecated unused django.utils.http.cookie_date().
üst
0afffae4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
1 deletion
+20
-1
http.py
django/utils/http.py
+7
-0
deprecation.txt
docs/internals/deprecation.txt
+2
-0
utils.txt
docs/ref/utils.txt
+4
-0
2.1.txt
docs/releases/2.1.txt
+4
-0
test_http.py
tests/utils_tests/test_http.py
+3
-1
No files found.
django/utils/http.py
Dosyayı görüntüle @
ab7f4c33
...
...
@@ -3,6 +3,7 @@ import calendar
import
datetime
import
re
import
unicodedata
import
warnings
from
binascii
import
Error
as
BinasciiError
from
email.utils
import
formatdate
from
urllib.parse
import
(
...
...
@@ -13,6 +14,7 @@ from urllib.parse import (
from
django.core.exceptions
import
TooManyFieldsSent
from
django.utils.datastructures
import
MultiValueDict
from
django.utils.deprecation
import
RemovedInDjango30Warning
from
django.utils.encoding
import
force_bytes
from
django.utils.functional
import
keep_lazy_text
...
...
@@ -118,6 +120,11 @@ def cookie_date(epoch_seconds=None):
Output a string in the format 'Wdy, DD-Mon-YYYY HH:MM:SS GMT'.
"""
warnings
.
warn
(
'cookie_date() is deprecated in favor of http_date(), which follows '
'the format of the latest RFC.'
,
RemovedInDjango30Warning
,
stacklevel
=
2
,
)
rfcdate
=
formatdate
(
epoch_seconds
)
return
'
%
s-
%
s-
%
s GMT'
%
(
rfcdate
[:
7
],
rfcdate
[
8
:
11
],
rfcdate
[
12
:
25
])
...
...
docs/internals/deprecation.txt
Dosyayı görüntüle @
ab7f4c33
...
...
@@ -31,6 +31,8 @@ details on these changes.
* ``django.contrib.gis.db.models.functions.ForceRHR`` will be removed.
* ``django.utils.http.cookie_date()`` will be removed.
See the :ref:`Django 2.1 release notes <deprecated-features-2.1>` for more
details on these changes.
...
...
docs/ref/utils.txt
Dosyayı görüntüle @
ab7f4c33
...
...
@@ -682,6 +682,10 @@ escaping HTML.
.. function:: cookie_date(epoch_seconds=None)
.. deprecated:: 2.1
Use :func:`http_date` instead, which follows the latest RFC.
Formats the time to ensure compatibility with Netscape's cookie standard.
Accepts a floating point number expressed in seconds since the epoch in
...
...
docs/releases/2.1.txt
Dosyayı görüntüle @
ab7f4c33
...
...
@@ -249,6 +249,10 @@ Miscellaneous
* The ``ForceRHR`` GIS function is deprecated in favor of the new
:class:`~django.contrib.gis.db.models.functions.ForcePolygonCW` function.
* ``django.utils.http.cookie_date()`` is deprecated in favor of
:func:`~django.utils.http.http_date`, which follows the format of the latest
RFC.
.. _removed-features-2.1:
Features removed in 2.1
...
...
tests/utils_tests/test_http.py
Dosyayı görüntüle @
ab7f4c33
import
unittest
from
datetime
import
datetime
from
django.test
import
SimpleTestCase
from
django.test
import
SimpleTestCase
,
ignore_warnings
from
django.utils.datastructures
import
MultiValueDict
from
django.utils.deprecation
import
RemovedInDjango30Warning
from
django.utils.http
import
(
base36_to_int
,
cookie_date
,
http_date
,
int_to_base36
,
is_safe_url
,
is_same_domain
,
parse_etags
,
parse_http_date
,
quote_etag
,
urlencode
,
...
...
@@ -254,6 +255,7 @@ class HttpDateProcessingTests(unittest.TestCase):
t
=
1167616461.0
self
.
assertEqual
(
http_date
(
t
),
'Mon, 01 Jan 2007 01:54:21 GMT'
)
@ignore_warnings
(
category
=
RemovedInDjango30Warning
)
def
test_cookie_date
(
self
):
t
=
1167616461.0
self
.
assertEqual
(
cookie_date
(
t
),
'Mon, 01-Jan-2007 01:54:21 GMT'
)
...
...
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