summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_tokens.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-12-01 11:38:01 +0100
committerClaude Paroz <claude@2xlibre.net>2017-01-18 16:21:28 +0100
commitc716fe87821df00f9f03ecc761c914d1682591a2 (patch)
tree0436706cdb190acbc76fb5fcf6d66f16e09fafa3 /tests/auth_tests/test_tokens.py
parente63d98b7beb16d1410168a2315cbe04c43c9c80d (diff)
downloaddjango-c716fe87821df00f9f03ecc761c914d1682591a2.tar.gz
Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
Diffstat (limited to 'tests/auth_tests/test_tokens.py')
-rw-r--r--tests/auth_tests/test_tokens.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/tests/auth_tests/test_tokens.py b/tests/auth_tests/test_tokens.py
index 7ff3f15f3d..0662ec513e 100644
--- a/tests/auth_tests/test_tokens.py
+++ b/tests/auth_tests/test_tokens.py
@@ -1,11 +1,9 @@
-import unittest
from datetime import date, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.test import TestCase
-from django.utils.six import PY3
class TokenGeneratorTest(TestCase):
@@ -51,18 +49,6 @@ class TokenGeneratorTest(TestCase):
p2 = Mocked(date.today() + timedelta(settings.PASSWORD_RESET_TIMEOUT_DAYS + 1))
self.assertFalse(p2.check_token(user, tk1))
- @unittest.skipIf(PY3, "Unnecessary test with Python 3")
- def test_date_length(self):
- """
- Overly long dates, which are a potential DoS vector, aren't allowed.
- """
- user = User.objects.create_user('ima1337h4x0r', 'test4@example.com', 'p4ssw0rd')
- p0 = PasswordResetTokenGenerator()
-
- # This will put a 14-digit base36 timestamp into the token, which is too large.
- with self.assertRaises(ValueError):
- p0._make_token_with_timestamp(user, 175455491841851871349)
-
def test_check_token_with_nonexistent_token_and_user(self):
user = User.objects.create_user('tokentestuser', 'test2@example.com', 'testpw')
p0 = PasswordResetTokenGenerator()