Ticket #7853: 7853-r8016-tests.diff
File 7853-r8016-tests.diff, 1.0 KB (added by , 16 years ago) |
---|
-
regressiontests/model_inheritance_regress/models.py
49 49 class Child(Parent): 50 50 name = models.CharField(max_length=10) 51 51 52 class SelfRefParent(models.Model): 53 parent_data = models.IntegerField() 54 self_data = models.ForeignKey('self', null=True) 55 56 class SelfRefChild(SelfRefParent): 57 child_data = models.IntegerField() 58 52 59 __test__ = {'API_TESTS':""" 53 60 # Regression for #7350, #7202 54 61 # Check that when you create a Parent object with a specific reference to an … … 159 166 ... 160 167 DoesNotExist: ItalianRestaurant matching query does not exist. 161 168 169 # Regression test for #7853 170 # If the parent class has a self-referential link, 171 # hilarity ensues during deletion of a child object 172 173 >>> obj = SelfRefChild.objects.create(child_data=37, parent_data=42) 174 >>> obj.delete() 175 162 176 """}