Ticket #7778: tests_queries.diff
File tests_queries.diff, 1.2 KB (added by , 16 years ago) |
---|
-
tests/regressiontests/queries/models.py
189 189 class Related(models.Model): 190 190 custom = models.ForeignKey(CustomPk) 191 191 192 # An inter-related setup with a model subclass that has a nullable 193 # path to another model, and a return path from that model. 192 194 195 class Celebrity(models.Model): 196 name = models.CharField("Name", max_length=20) 197 greatest_fan = models.ForeignKey("Fan", null=True, unique=True) 198 199 class TvChef(Celebrity): 200 pass 201 202 class Fan(models.Model): 203 fan_of = models.ForeignKey(Celebrity) 204 205 193 206 __test__ = {'API_TESTS':""" 194 207 >>> t1 = Tag.objects.create(name='t1') 195 208 >>> t2 = Tag.objects.create(name='t2', parent=t1) … … 830 843 ... obj.save() 831 844 ... if i > 10: break 832 845 846 Bug #7778 - Model subclasses cannot be deleted if a nullable foreign key relates 847 to a model that relates back. 848 849 >>> tvc = TvChef.objects.create(name="Huey") 850 >>> f1 = Fan.objects.create(fan_of=tvc) 851 >>> f2 = Fan.objects.create(fan_of=tvc) 852 >>> tvc.delete() 833 853 """} 834 854