field_subclassing test failing, needs to use get_prep_lookup
|Reported by:||gabrielhurley||Owned by:||gabrielhurley|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I ran the full unit test suite this morning (Windows, SQLite3), and found that the field_subclassing tests were failing because the expected error for an invalid lookup_type wasn't being raised.
It turns out that the test had not been updated to reflect get_prep_lookup() being factored out of get_db_prep_lookup().
This patch corrects that, and raises a TypeError instead of a FieldError, since the docs say "Your method must be prepared to handle all of these lookup_type values and should raise [...] a TypeError if your field does not support that type of lookup."
Patch is attached, and the test now passes.
Change History (10)
Changed 5 years ago by gabrielhurley
comment:1 Changed 5 years ago by kmtracey
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset