Ticket #10967: 10967-test.diff

File 10967-test.diff, 1.0 KB (added by Karen Tracey, 15 years ago)
  • tests/regressiontests/model_inheritance_regress/models.py

     
    110110        return "PK = %d, base_name = %s, derived_name = %s" \
    111111                % (self.customPK, self.base_name, self.derived_name)
    112112
     113class DerivedM2(BaseM):
     114    pass
     115
    113116# Check that abstract classes don't get m2m tables autocreated.
    114117class Person(models.Model):
    115118    name = models.CharField(max_length=100)
     
    385388>>> p4.bachelorparty_set.all()
    386389[<BachelorParty: Bachelor party for Bob>, <BachelorParty: Bachelor party for Dave>]
    387390
     391# with multi-table inheritance, forcing an update using a child model with no
     392# fields of its own should work (regression test for #10967)
     393>>> dm2 = DerivedM2.objects.create(base_name='Basic')
     394>>> dm2.base_name = 'Advanced'
     395>>> dm2.save(force_update=True)
     396
     397
    388398"""}
    389399
Back to Top