diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2010-10-19 19:42:36 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2010-10-19 19:42:36 +0000 |
| commit | 6a369d2ff385edd3bbc2b8e0ab659f8fdef767d3 (patch) | |
| tree | 177b555b00a221393ce13c13589292c71212f813 | |
| parent | ed195a6fd399d9d236300ecc4858a45bfbaf6659 (diff) | |
[1.2.X] Fixed errors introduced in r14280 when running Django tests under Python < 2.6.
Backport of [14287] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14289 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | tests/regressiontests/queries/tests.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py index a5ab889279..7302e700e4 100644 --- a/tests/regressiontests/queries/tests.py +++ b/tests/regressiontests/queries/tests.py @@ -1430,7 +1430,8 @@ class CloneTests(TestCase): class EmptyQuerySetTests(TestCase): def test_emptyqueryset_values(self): - "#14366 -- calling .values() on an EmptyQuerySet and then cloning that should not cause an error" + # #14366 -- calling .values() on an EmptyQuerySet and then cloning that + # should not cause an error self.assertEqual(list(Number.objects.none().values('num').order_by('num')), []) def test_values_subquery(self): @@ -1483,11 +1484,19 @@ class EscapingTests(TestCase): # the way Python handles list() calls internally. Thus, we skip the tests for # Python 2.6. if sys.version_info[:2] != (2, 6): - class OrderingLoopTests(TestCase): + class OrderingLoopTests(BaseQuerysetTest): + def setUp(self): + generic = NamedCategory.objects.create(name="Generic") + t1 = Tag.objects.create(name='t1', category=generic) + t2 = Tag.objects.create(name='t2', parent=t1, category=generic) + t3 = Tag.objects.create(name='t3', parent=t1) + t4 = Tag.objects.create(name='t4', parent=t3) + t5 = Tag.objects.create(name='t5', parent=t3) + def test_infinite_loop(self): # If you're not careful, it's possible to introduce infinite loops via # default ordering on foreign keys in a cycle. We detect that. - self.assertRaises( + self.assertRaisesMessage( FieldError, 'Infinite loop caused by ordering.', LoopX.objects.all |
