Fixed #19895 -- Second iterator over invalid qs raises errors

The fix was already in the patch for #18702, so only test added for
ticket #19895.
This commit is contained in:
Anssi Kääriäinen 2013-05-22 08:28:17 +03:00
parent 90a6c3aaf0
commit 904084611d
1 changed files with 7 additions and 0 deletions

View File

@ -2504,6 +2504,13 @@ class IteratorExceptionsTest(TestCase):
with self.assertRaises(AttributeError):
list(qs)
def test_invalid_qs_list(self):
# Test for #19895 - second iteration over invalid queryset
# raises errors.
qs = Article.objects.order_by('invalid_column')
self.assertRaises(FieldError, list, qs)
self.assertRaises(FieldError, list, qs)
class NullJoinPromotionOrTest(TestCase):
def setUp(self):