Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

[1.5.x] Fixed #21118 -- Isolated a test that uses the database.

Thanks rmboggs for the report.

Backport of 4f40b97 from master
  • Loading branch information...
commit 72f7932cfbe079f5063a2f1b4c09b520d99f5e42 1 parent 6a708cd
@timgraham timgraham authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 tests/regressiontests/utils/
7 tests/regressiontests/utils/
@@ -3,6 +3,8 @@
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 @@ def test_pickle_complex(self):
self.assertEqual(six.text_type(unpickled), six.text_type(x))
- 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', '', 'pass')
x = SimpleLazyObject(lambda: user)

0 comments on commit 72f7932

Please sign in to comment.
Something went wrong with that request. Please try again.