#15170: inspectdb test fails under MySQL MyISAM
--------------------------------+-------------------------------------------
 Reporter:  russellm            |       Owner:  nobody    
   Status:  new                 |   Milestone:  1.3       
Component:  Testing framework   |     Version:  1.2       
 Keywords:  blocker regression  |       Stage:  Unreviewed
Has_patch:  0                   |  
--------------------------------+-------------------------------------------
 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.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15170>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to