From 6b7f1c2530784ed6c6c1826688faaa08e3f786d9 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Sat, 3 Nov 2018 16:13:28 +0100 Subject: [PATCH] Increased test coverage of django.utils.http. --- tests/utils_tests/test_http.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py index 1cbb0d96bf..93f45fb936 100644 --- a/tests/utils_tests/test_http.py +++ b/tests/utils_tests/test_http.py @@ -233,6 +233,7 @@ class IsSameDomainTests(unittest.TestCase): ('example2.com', 'example.com'), ('foo.example.com', 'example.com'), ('example.com:9999', 'example.com:8888'), + ('foo.example.com:8888', ''), ): self.assertIs(is_same_domain(*pair), False) @@ -276,6 +277,10 @@ class HttpDateProcessingTests(unittest.TestCase): parsed = parse_http_date('Sun Nov 6 08:49:37 1994') self.assertEqual(datetime.utcfromtimestamp(parsed), datetime(1994, 11, 6, 8, 49, 37)) + def test_parsing_year_less_than_70(self): + parsed = parse_http_date('Sun Nov 6 08:49:37 0050') + self.assertEqual(datetime.utcfromtimestamp(parsed), datetime(2050, 11, 6, 8, 49, 37)) + class EscapeLeadingSlashesTests(unittest.TestCase): def test(self):