#15170 closed (fixed)
inspectdb test fails under MySQL MyISAM
Reported by: | Russell Keith-Magee | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | 1.2 |
Severity: | Keywords: | blocker regression | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
As of r15325, the inspectdb test fails under MySQL MyISAM. It passes under InnoDB.
====================================================================== FAIL: test_attribute_name_not_python_keyword (regressiontests.inspectdb.tests.InspectDBTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/rkm/projects/django/hg/tests/regressiontests/inspectdb/tests.py", line 13, in test_attribute_name_not_python_keyword self.assertIn("from_field = models.ForeignKey(InspectdbPeople)", out.getvalue()) AssertionError: 'from_field = models.ForeignKey(InspectdbPeople)' not found in u"# This is an auto-generated Django model ... ---------------------------------------------------------------------- Ran 1 test in 0.188s FAILED (failures=1)
Note - I've truncated the output because it runs to thousands of characters on one line.
The problem is that MySQL's introspection backend doesn't identify foreign keys -- it identifies them as integer fields. As a result, the test fails because the field 'from' is identified as 'from_id', which isn't a colliding name.
Given that this is a limitation of MyISAM, we probably just need to skip the test -- which means we need a new live capability check in the features backend (can_introspect_foreign_key, or simliar). Unless, of course, someone can find a nifty way to fix the introspection.
Change History (3)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In [15385]: