summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/model_regress/test_pickle.py7
-rw-r--r--tests/queryset_pickle/tests.py7
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/model_regress/test_pickle.py b/tests/model_regress/test_pickle.py
index f8676404c0..6a09c3734f 100644
--- a/tests/model_regress/test_pickle.py
+++ b/tests/model_regress/test_pickle.py
@@ -1,8 +1,8 @@
import pickle
+import django
from django.db import DJANGO_VERSION_PICKLE_KEY, models
from django.test import SimpleTestCase
-from django.utils.version import get_version
class ModelPickleTests(SimpleTestCase):
@@ -40,7 +40,10 @@ class ModelPickleTests(SimpleTestCase):
return reduce_list
p = DifferentDjangoVersion(title="FooBar")
- msg = "Pickled model instance's Django version 1.0 does not match the current version %s." % get_version()
+ msg = (
+ "Pickled model instance's Django version 1.0 does not match the "
+ "current version %s." % django.__version__
+ )
with self.assertRaisesMessage(RuntimeWarning, msg):
pickle.loads(pickle.dumps(p))
diff --git a/tests/queryset_pickle/tests.py b/tests/queryset_pickle/tests.py
index 793141cfdd..baf2e96aaf 100644
--- a/tests/queryset_pickle/tests.py
+++ b/tests/queryset_pickle/tests.py
@@ -1,9 +1,9 @@
import datetime
import pickle
+import django
from django.db import models
from django.test import TestCase
-from django.utils.version import get_version
from .models import Container, Event, Group, Happening, M2MModel, MyEvent
@@ -234,7 +234,10 @@ class PickleabilityTestCase(TestCase):
unpickled with a different Django version than the current
"""
qs = Group.previous_django_version_objects.all()
- msg = "Pickled queryset instance's Django version 1.0 does not match the current version %s." % get_version()
+ msg = (
+ "Pickled queryset instance's Django version 1.0 does not match "
+ "the current version %s." % django.__version__
+ )
with self.assertRaisesMessage(RuntimeWarning, msg):
pickle.loads(pickle.dumps(qs))