paulocheque / django-dynamic-fixture

A complete library to create dynamic model instances for testing purposes.
http://django-dynamic-fixture.readthedocs.io/
Other
391 stars 67 forks source link

Fix field_has_choices() when field.choices is an itertools.tee. #27

Closed qris closed 10 years ago

qris commented 11 years ago

Fixes this error:

File "/home/installuser/Dropbox/projects/ischool/user_manager/django/django-dynamic-fixture/django_dynamic_fixture/django_helper.py", line 138, in field_has_choices
    return bool(len(field.choices) > 0 and field.choices)
TypeError: object of type 'itertools.tee' has no len()