#10967: save(force_update=True) crashes with model inheritance
---------------------------------------------------+------------------------
          Reporter:  lgs                           |         Owner:  nobody
            Status:  new                           |     Milestone:  1.2   
         Component:  Database layer (models, ORM)  |       Version:  1.0   
        Resolution:                                |      Keywords:        
             Stage:  Accepted                      |     Has_patch:  1     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  1                             |  
---------------------------------------------------+------------------------
Changes (by kmtracey):

  * needs_better_patch:  0 => 1

Comment:

 I've attached a diff with a test added to model_inheritance_regress.
 However, the proposed fix causes other tests in that testcase to fail:

 {{{
 Doctest:
 regressiontests.model_inheritance_regress.models.__test__.API_TESTS ...
 FAIL

 ======================================================================
 FAIL: Doctest:
 regressiontests.model_inheritance_regress.models.__test__.API_TESTS
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/kmt/django/trunk/django/test/_doctest.py", line 2180, in
 runTest
     raise self.failureException(self.format_failure(new.getvalue()))
 AssertionError: Failed doctest test for
 regressiontests.model_inheritance_regress.models.__test__.API_TESTS
   File
 
"/home/kmt/django/trunk/tests/regressiontests/model_inheritance_regress/models.py",
 line unknown line number, in API_TESTS

 ----------------------------------------------------------------------
 File
 
"/home/kmt/django/trunk/tests/regressiontests/model_inheritance_regress/models.py",
 line ?, in
 regressiontests.model_inheritance_regress.models.__test__.API_TESTS
 Failed example:
     Place.objects.all()
 Expected:
     [<Place: Derelict lot the place>, <Place: Guido's All New House of
 Pasta the place>]
 Got:
     [<Place: Guido's House of Pasta the place>, <Place: Main St the
 place>]
 ----------------------------------------------------------------------
 File
 
"/home/kmt/django/trunk/tests/regressiontests/model_inheritance_regress/models.py",
 line ?, in
 regressiontests.model_inheritance_regress.models.__test__.API_TESTS
 Failed example:
     [sorted(d.items()) for d in dicts] == [[('name', u"Guido's All New
 House of Pasta"), ('serves_hot_dogs', False)]]
 Expected:
     True
 Got:
     False
 ----------------------------------------------------------------------
 File
 
"/home/kmt/django/trunk/tests/regressiontests/model_inheritance_regress/models.py",
 line ?, in
 regressiontests.model_inheritance_regress.models.__test__.API_TESTS
 Failed example:
     [sorted(d.items()) for d in dicts] == [[('name', u"Guido's All New
 House of Pasta"), ('serves_gnocchi', False), ('serves_hot_dogs', False)]]
 Expected:
     True
 Got:
     False
 ----------------------------------------------------------------------
 File
 
"/home/kmt/django/trunk/tests/regressiontests/model_inheritance_regress/models.py",
 line ?, in
 regressiontests.model_inheritance_regress.models.__test__.API_TESTS
 Failed example:
     [sorted(d.items()) for d in dicts]
 Expected:
     [[('capacity', 50), ('name', u'Derelict lot')]]
 Got:
     [[('capacity', 100), ('name', u'Main St')]]
 ----------------------------------------------------------------------
 File
 
"/home/kmt/django/trunk/tests/regressiontests/model_inheritance_regress/models.py",
 line ?, in
 regressiontests.model_inheritance_regress.models.__test__.API_TESTS
 Failed example:
     [sorted(d.items()) for d in dicts] == [[('name', u"Guido's All New
 House of Pasta"), ('serves_gnocchi', False), ('serves_hot_dogs', False)]]
 Expected:
     True
 Got:
     False
 ----------------------------------------------------------------------
 File
 
"/home/kmt/django/trunk/tests/regressiontests/model_inheritance_regress/models.py",
 line ?, in
 regressiontests.model_inheritance_regress.models.__test__.API_TESTS
 Failed example:
     Place.objects.get(pk=ident)
 Expected:
     <Place: Guido's All New House of Pasta the place>
 Got:
     <Place: Guido's House of Pasta the place>


 ----------------------------------------------------------------------
 Ran 1 test in 0.566s

 FAILED (failures=1)

 }}}

 Thus it seems the proposed fix is not quite right and a correct fix
 requires some more investigation.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10967#comment:4>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to