Ticket #3077: 3077-test.diff
File 3077-test.diff, 1.5 KB (added by , 16 years ago) |
---|
-
tests/regressiontests/model_regress/models.py
58 58 # object). 59 59 return 'Názov: %s' % self.name 60 60 61 class OneToOneChainA(models.Model): 62 key = models.CharField(max_length=10, primary_key=True) 61 63 64 class OneToOneChainB(models.Model): 65 a = models.OneToOneField(OneToOneChainA, primary_key=True) 66 67 class OneToOneChainC(models.Model): 68 a = models.ForeignKey(OneToOneChainA) 69 b = models.OneToOneField(OneToOneChainB, primary_key=True) 70 71 class OneToOneChainD(models.Model): 72 a = models.ForeignKey(OneToOneChainA) 73 b = models.ForeignKey(OneToOneChainB) 74 c = models.OneToOneField(OneToOneChainC, primary_key=True) 75 62 76 __test__ = {'API_TESTS': """ 63 77 (NOTE: Part of the regression test here is merely parsing the model 64 78 declaration. The verbose_name, in particular, did not always work.) … … 147 161 >>> BrokenUnicodeMethod.objects.all() 148 162 [<BrokenUnicodeMethod: [Bad Unicode data]>] 149 163 164 # Regression test for #3077 165 >>> OneToOneChainB._meta.pk.db_type() == OneToOneChainA._meta.pk.db_type() 166 True 167 >>> OneToOneChainC._meta.pk.db_type() == OneToOneChainA._meta.pk.db_type() 168 True 169 >>> OneToOneChainD._meta.pk.db_type() == OneToOneChainA._meta.pk.db_type() 170 True 171 150 172 """} 151 173 152 174 if settings.DATABASE_ENGINE not in ("mysql", "oracle"):