mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
@@ -121,27 +121,27 @@ class TestUtilsHttp(unittest.TestCase):
|
||||
|
||||
|
||||
class ETagProcessingTests(unittest.TestCase):
|
||||
def testParsing(self):
|
||||
def test_parsing(self):
|
||||
etags = http.parse_etags(r'"", "etag", "e\"t\"ag", "e\\tag", W/"weak"')
|
||||
self.assertEqual(etags, ['', 'etag', 'e"t"ag', r'e\tag', 'weak'])
|
||||
|
||||
def testQuoting(self):
|
||||
def test_quoting(self):
|
||||
quoted_etag = http.quote_etag(r'e\t"ag')
|
||||
self.assertEqual(quoted_etag, r'"e\\t\"ag"')
|
||||
|
||||
|
||||
class HttpDateProcessingTests(unittest.TestCase):
|
||||
def testParsingRfc1123(self):
|
||||
def test_parsing_rfc1123(self):
|
||||
parsed = http.parse_http_date('Sun, 06 Nov 1994 08:49:37 GMT')
|
||||
self.assertEqual(datetime.utcfromtimestamp(parsed),
|
||||
datetime(1994, 11, 6, 8, 49, 37))
|
||||
|
||||
def testParsingRfc850(self):
|
||||
def test_parsing_rfc850(self):
|
||||
parsed = http.parse_http_date('Sunday, 06-Nov-94 08:49:37 GMT')
|
||||
self.assertEqual(datetime.utcfromtimestamp(parsed),
|
||||
datetime(1994, 11, 6, 8, 49, 37))
|
||||
|
||||
def testParsingAsctime(self):
|
||||
def test_parsing_asctime(self):
|
||||
parsed = http.parse_http_date('Sun Nov 6 08:49:37 1994')
|
||||
self.assertEqual(datetime.utcfromtimestamp(parsed),
|
||||
datetime(1994, 11, 6, 8, 49, 37))
|
||||
|
||||
Reference in New Issue
Block a user