summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2013-09-18 09:43:34 -0400
committerTim Graham <timograham@gmail.com>2013-09-18 09:43:34 -0400
commit72f7932cfbe079f5063a2f1b4c09b520d99f5e42 (patch)
tree6ae4c07eeca3e4a8a603f3f95fa93117f915e47a
parent6a708cd654fe63278ea8a14b3e44da847c62ebf4 (diff)
[1.5.x] Fixed #21118 -- Isolated a test that uses the database.
Thanks rmboggs for the report. Backport of 4f40b97d97 from master
-rw-r--r--tests/regressiontests/utils/simplelazyobject.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/regressiontests/utils/simplelazyobject.py b/tests/regressiontests/utils/simplelazyobject.py
index 2dd382cf04..5ef80a8114 100644
--- a/tests/regressiontests/utils/simplelazyobject.py
+++ b/tests/regressiontests/utils/simplelazyobject.py
@@ -3,6 +3,8 @@ from __future__ import unicode_literals
import copy
import pickle
+from django.contrib.auth.models import User
+from django.test import TestCase as DjangoTestCase
from django.test.utils import str_prefix
from django.utils import six
from django.utils.unittest import TestCase
@@ -122,9 +124,10 @@ class TestUtilsSimpleLazyObject(TestCase):
self.assertEqual(six.text_type(unpickled), six.text_type(x))
self.assertEqual(unpickled.name, x.name)
- def test_pickle_py2_regression(self):
- from django.contrib.auth.models import User
+class TestUtilsSimpleLazyObjectDjangoTestCase(DjangoTestCase):
+
+ def test_pickle_py2_regression(self):
# See ticket #20212
user = User.objects.create_user('johndoe', 'john@example.com', 'pass')
x = SimpleLazyObject(lambda: user)