Description

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."

So, as noted on #13172, the test failure was due to a version-specific bug in Python 2.6.1 and upgrading to version 2.6.5 made the test start passing again. Sorry for that.

However, since the docs now recommend doing db-agnostic checks like validating lookup_type in get_prep_lookup() and that a TypeError should be raised, the patch is still technically valid. It's just not very important.

Sadly that's all the more reason to apply the patch... even if its a Python problem at its core there are still gonna be a number of people out there running 2.6.1 if it's the default version included in SL.