summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2021-05-05 23:28:08 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-05-07 11:57:40 +0200
commit028f10fac651292edf8d50e013b16a52862e4c08 (patch)
treedacf9d5fcd6e337a213bbd2a942a7894768955e6 /tests
parentc4ee3b208a2c95a5102b5e4fa789b10f8ee29b84 (diff)
Fixed #32712 -- Deprecated django.utils.baseconv module.
Diffstat (limited to 'tests')
-rw-r--r--tests/signing/tests.py7
-rw-r--r--tests/utils_tests/test_baseconv.py11
2 files changed, 15 insertions, 3 deletions
diff --git a/tests/signing/tests.py b/tests/signing/tests.py
index 4b9cec7d25..1bd7277bc6 100644
--- a/tests/signing/tests.py
+++ b/tests/signing/tests.py
@@ -195,3 +195,10 @@ class TestTimestampSigner(SimpleTestCase):
self.assertEqual(signer.unsign(ts, max_age=datetime.timedelta(seconds=11)), value)
with self.assertRaises(signing.SignatureExpired):
signer.unsign(ts, max_age=10)
+
+
+class TestBase62(SimpleTestCase):
+ def test_base62(self):
+ tests = [-10 ** 10, 10 ** 10, 1620378259, *range(-100, 100)]
+ for i in tests:
+ self.assertEqual(i, signing.b62_decode(signing.b62_encode(i)))
diff --git a/tests/utils_tests/test_baseconv.py b/tests/utils_tests/test_baseconv.py
index b6bfc5ef20..989e1eb0bf 100644
--- a/tests/utils_tests/test_baseconv.py
+++ b/tests/utils_tests/test_baseconv.py
@@ -1,10 +1,15 @@
from unittest import TestCase
-from django.utils.baseconv import (
- BaseConverter, base2, base16, base36, base56, base62, base64,
-)
+from django.test import ignore_warnings
+from django.utils.deprecation import RemovedInDjango50Warning
+with ignore_warnings(category=RemovedInDjango50Warning):
+ from django.utils.baseconv import (
+ BaseConverter, base2, base16, base36, base56, base62, base64,
+ )
+
+# RemovedInDjango50Warning
class TestBaseConv(TestCase):
def test_baseconv(self):