16 | 18 | The reason for the failure, is that immediately after `StumpJokeForm()` is instantiated (by the second of the two tests) the field's `queryset._result_cache` is already populated, holding an instance which no longer exists in the database as it was flushed between tests. It's as if the field's queryset is persisting between form instantiations, and between tests. It looks likely that this wouldn't show up in a normal Django test run because IDs are sequential there and so the IDs match when testing the assertion. |