mirror of
https://github.com/django/django.git
synced 2025-10-30 09:06:13 +00:00
Fixed #20094 - Be more careful when checking for Iterator
Python 2.6 has some different behaviour when checking isinstance(foo, collections.Iterator).
This commit is contained in:
committed by
Claude Paroz
parent
f7795e968d
commit
829dc3c5a6
11
tests/utils_tests/itercompat.py
Normal file
11
tests/utils_tests/itercompat.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from .models import Category, Thing
|
||||
|
||||
|
||||
class TestIsIterator(TestCase):
|
||||
def test_regression(self):
|
||||
"""This failed on Django 1.5/Py2.6 because category has a next method."""
|
||||
category = Category.objects.create(name='category')
|
||||
Thing.objects.create(category=category)
|
||||
Thing.objects.filter(category=category)
|
||||
Reference in New Issue
Block a user