The test is supposed to iterate through a collection of fields and run
some tests on each field in the collection.
These asserts never actually get called because the collection is empty.
To reproduce, simply run the following:
PYTHONPATH=..$PYTHONPATH ./runtests.py model_fields
The other tests in model_fields look like they may have the same problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/24667>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* easy: 0 => 1
* stage: Unreviewed => Accepted
Comment:
Hi,
If I understand correctly, the problem is that a generator comprehension
is used so it can only be iterated over once.
We should use a list comprehension instead.
--
Ticket URL: <https://code.djangoproject.com/ticket/24667#comment:1>
* owner: nobody => yoongkang
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/24667#comment:2>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24667#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"36eab95e7fde7fad4368192ddbef4e2dbb32dc91" 36eab95e]:
{{{
#!CommitTicketReference repository=""
revision="36eab95e7fde7fad4368192ddbef4e2dbb32dc91"
Fixed #24667 --- Repaired model_fields cardinality test
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24667#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"b8f203b3f27b1dc02ad84b616092bcf03337fc51" b8f203b3]:
{{{
#!CommitTicketReference repository=""
revision="b8f203b3f27b1dc02ad84b616092bcf03337fc51"
[1.8.x] Fixed #24667 --- Repaired model_fields cardinality test
Backport of 36eab95e7fde7fad4368192ddbef4e2dbb32dc91 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24667#comment:5>