summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStorm B. Heg <storm@stormbase.digital>2026-02-12 14:10:17 +0100
committerSaptak Sengupta <saptak013@gmail.com>2026-02-19 22:35:40 +0530
commit9529908208ba3be5b8cdd66103e7d9458ad5c290 (patch)
tree164f63d1e2fdb0180a8af7346dfac31496622581
parent7544c17356a790510ebb3bcc41cfb95e535222f2 (diff)
Drop security.txt expiration warning in tests
-rw-r--r--djangoproject/tests.py15
-rw-r--r--docs/tests/test_views.py14
2 files changed, 1 insertions, 28 deletions
diff --git a/djangoproject/tests.py b/djangoproject/tests.py
index c9b03322..21cacf7e 100644
--- a/djangoproject/tests.py
+++ b/djangoproject/tests.py
@@ -1,9 +1,8 @@
import re
-import warnings
-from datetime import datetime, timedelta
from http import HTTPStatus
from io import StringIO
+from django.conf import settings
from django.core.management import call_command
from django.test import TestCase
from django.urls import NoReverseMatch, get_resolver
@@ -233,15 +232,3 @@ class SecurityTxtTests(TestCase):
)
if match is None:
self.fail("No Expires line found in security.txt")
- else:
- expires = match[1]
-
- expires_date = datetime.fromisoformat(expires).date()
-
- if expires_date < datetime.now().date() - timedelta(days=15):
- warnings.warn(
- "The djangoproject/templates/well-known/security.txt file is"
- " close to expiring. Please update the 'Expires' line to confirm"
- " the contents are still accurate.",
- category=UserWarning,
- )
diff --git a/docs/tests/test_views.py b/docs/tests/test_views.py
index dea953c4..a05281ab 100644
--- a/docs/tests/test_views.py
+++ b/docs/tests/test_views.py
@@ -1,6 +1,4 @@
import re
-import warnings
-from datetime import datetime, timedelta
from http import HTTPStatus
from django.conf import settings
@@ -347,15 +345,3 @@ class SecurityTxtTests(TestCase):
)
if match is None:
self.fail("No Expires line found in security.txt")
- else:
- expires = match[1]
-
- expires_date = datetime.fromisoformat(expires).date()
-
- if expires_date < datetime.now().date() - timedelta(days=15):
- warnings.warn(
- "The djangoproject/templates/well-known/security.txt file is"
- " close to expiring. Please update the 'Expires' line to confirm"
- " the contents are still accurate.",
- category=UserWarning,
- )