Ticket #13562: 13562_test_only.diff
File 13562_test_only.diff, 1.1 KB (added by , 13 years ago) |
---|
-
tests/modeltests/one_to_one/tests.py
117 117 mm = MultiModel(link1=self.p2, link2=o1, name="x1") 118 118 self.assertRaises(IntegrityError, mm.save) 119 119 transaction.savepoint_rollback(sid) 120 121 def test_values(self): 122 places = Place.objects.filter(pk=1).values('name', 'restaurant__serves_hot_dogs') 123 self.assertTrue(places[0]['restaurant__serves_hot_dogs']) -
tests/modeltests/one_to_one/models.py
16 16 return u"%s the place" % self.name 17 17 18 18 class Restaurant(models.Model): 19 place = models.OneToOneField(Place, primary_key=True )19 place = models.OneToOneField(Place, primary_key=True, related_name='restaurant') 20 20 serves_hot_dogs = models.BooleanField() 21 21 serves_pizza = models.BooleanField() 22 22