diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2010-12-18 23:10:29 +0000 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2010-12-18 23:10:29 +0000 |
| commit | d5c15a490e84d858a531e4a79aef49893ce1706a (patch) | |
| tree | f7c0238c5ffb587f60427c23f5499b4ea5e1029c | |
| parent | 160533410fcb94c41f6481880d80500dae57b34e (diff) | |
[1.2.X] Fixed a couple of tests migrated to unit tests in r14279 so they actually and correctly exercise the functionality under test.
Backport of [14981] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14982 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | tests/regressiontests/queries/tests.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py index 68811ed9c9..741b33cd49 100644 --- a/tests/regressiontests/queries/tests.py +++ b/tests/regressiontests/queries/tests.py @@ -27,6 +27,12 @@ class BaseQuerysetTest(TestCase): except Exception, e: self.assertEqual(msg, str(e)) self.assertTrue(isinstance(e, exc), "Expected %s, got %s" % (exc, type(e))) + else: + if hasattr(exc, '__name__'): + excName = exc.__name__ + else: + excName = str(exc) + raise AssertionError, "%s not raised" % excName class Queries1Tests(BaseQuerysetTest): @@ -1516,12 +1522,12 @@ if sys.version_info[:2] != (2, 6): self.assertRaisesMessage( FieldError, 'Infinite loop caused by ordering.', - LoopX.objects.all + lambda: list(LoopX.objects.all()) # Force queryset evaluation with list() ) self.assertRaisesMessage( FieldError, 'Infinite loop caused by ordering.', - LoopZ.objects.all + lambda: list(LoopZ.objects.all()) # Force queryset evaluation with list() ) # Note that this doesn't cause an infinite loop, since the default |
