diff options
author | Tim Graham <timograham@gmail.com> | 2015-04-01 19:15:27 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-04-02 08:14:08 -0400 |
commit | 0f941f57ba29088e56fcd6639b0b68781d11f837 (patch) | |
tree | ec7b56ec400e754abfd0ad0384b3417dfdc9440d /tests/model_regress | |
parent | 8f987323791181783d3f1ba847ffc0a938ddccdf (diff) | |
download | django-0f941f57ba29088e56fcd6639b0b68781d11f837.tar.gz |
Fixed mistakes in tests unveiled by version bump to 1.8.1.
Forwardport of e7366ab1f908b8cbf8d7e83037b5f17d101b5ade from stable/1.8.x
Diffstat (limited to 'tests/model_regress')
-rw-r--r-- | tests/model_regress/test_pickle.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/model_regress/test_pickle.py b/tests/model_regress/test_pickle.py index 086d4ea79a..6f377d1d96 100644 --- a/tests/model_regress/test_pickle.py +++ b/tests/model_regress/test_pickle.py @@ -9,7 +9,7 @@ from django.core.files.temp import NamedTemporaryFile from django.db import DJANGO_VERSION_PICKLE_KEY, models from django.test import TestCase from django.utils.encoding import force_text -from django.utils.version import get_major_version, get_version +from django.utils.version import get_version from .models import Article @@ -47,17 +47,18 @@ class ModelPickleTestCase(TestCase): def __reduce__(self): reduce_list = super(DifferentDjangoVersion, self).__reduce__() data = reduce_list[-1] - data[DJANGO_VERSION_PICKLE_KEY] = str(float(get_major_version()) - 0.1) + data[DJANGO_VERSION_PICKLE_KEY] = '1.0' return reduce_list p = DifferentDjangoVersion(title="FooBar") with warnings.catch_warnings(record=True) as recorded: pickle.loads(pickle.dumps(p)) msg = force_text(recorded.pop().message) - self.assertEqual(msg, - "Pickled model instance's Django version %s does not " - "match the current version %s." - % (str(float(get_major_version()) - 0.1), get_version())) + self.assertEqual( + msg, + "Pickled model instance's Django version 1.0 does not " + "match the current version %s." % get_version() + ) def test_unpickling_when_appregistrynotready(self): """ |