Ticket #7202: onetoone_fixtures_test_r7526.patch
File onetoone_fixtures_test_r7526.patch, 1.1 KB (added by , 16 years ago) |
---|
-
tests/regressiontests/fixtures_regress/models.py
38 38 super(Absolute, self).__init__(*args, **kwargs) 39 39 Absolute.load_count += 1 40 40 41 class Parent(models.Model): 42 name = models.CharField(max_length=60, unique=True) 43 44 def __unicode__(self): 45 return self.name 46 47 class Child(Parent): 48 parent = models.OneToOneField(Parent, parent_link=True) 49 number = models.IntegerField(max_length=20) 50 51 def __unicode__(self): 52 return "%s - %d" % (self.name, self.number) 53 41 54 42 55 __test__ = {'API_TESTS':""" 43 56 >>> from django.core import management … … 71 84 >>> Absolute.load_count 72 85 1 73 86 87 ############################################## 88 # Regression test for ticket #7202 -- 89 # Make sure that children of One-to-One relations don't try to duplicate parent 90 >>> Parent.objects.all().delete() 91 >>> management.call_command('loaddata', 'onetoone', verbosity=0) 92 93 >>> len(Parent.objects.all()) 94 1 95 74 96 """}