          # key on Restaurant, the save will create a new restaurant
          self.r.place = self.p2
          self.r.save()
          self.assertEqual(repr(self.p2.restaurant), '<Restaurant: Ace Hardware the restaurant>')
          self.assertEqual(repr(self.r.place), '<Place: Ace Hardware the place>')
          self.assertEqual(self.p2.pk, self.r.pk)
          # Set the place back again, using assignment in the reverse direction.
          self.p1.restaurant = self.r
          self.assertEqual(repr(self.p1.restaurant), '<Restaurant: Demon Dogs the restaurant>')
          r = Restaurant.objects.get(pk=self.p1.id)
          self.assertEqual(repr(r.place), '<Place: Demon Dogs the place>')
 
</s> remove         self.r.place = self.p2
        self.r.save()
 </s> add         self.r1.place = self.p2
        self.r1.save() </s> remove         self.p1.restaurant = self.r
 </s> add         self.p1.restaurant = self.r1 </s> remove         self.assertEqual(repr(self.r.place), '<Place: Demon Dogs the place>')
 </s> add         self.assertEqual(repr(self.r1.place), '<Place: Demon Dogs the place>') </s> remove         self.p1 = Place(name='Demon Dogs', address='944 W. Fullerton')
        self.p1.save()
        self.p2 = Place(name='Ace Hardware', address='1013 N. Ashland')
        self.p2.save()
        self.r = Restaurant(place=self.p1, serves_hot_dogs=True, serves_pizza=False)
        self.r.save()
 </s> add         self.p1 = Place.objects.create(name='Demon Dogs', address='944 W. Fullerton')
        self.p2 = Place.objects.create(name='Ace Hardware', address='1013 N. Ashland')
        self.r1 = Restaurant.objects.create(place=self.p1, serves_hot_dogs=True, serves_pizza=False)
        self.b1 = Bar.objects.create(place=self.p1, serves_cocktails=False) </s> remove         w = self.r.waiter_set.create(name='Joe')
        w.save()
 </s> add         w = self.r1.waiter_set.create(name='Joe')
        self.assertEqual(repr(self.r1.place), '<Place: Ace Hardware the place>')
        self.assertEqual(self.p2.pk, self.r1.pk)
          # key on Restaurant, the save will create a new restaurant
          self.r.place = self.p2
          self.r.save()
          self.assertEqual(repr(self.p2.restaurant), '<Restaurant: Ace Hardware the restaurant>')
        self.assertEqual(repr(self.r1.place), '<Place: Ace Hardware the place>')
        self.assertEqual(self.p2.pk, self.r1.pk)
        self.assertEqual(repr(self.r1.place), '<Place: Ace Hardware the place>')
        self.assertEqual(self.p2.pk, self.r1.pk)
          # Set the place back again, using assignment in the reverse direction.
          self.p1.restaurant = self.r
          self.assertEqual(repr(self.p1.restaurant), '<Restaurant: Demon Dogs the restaurant>')
          r = Restaurant.objects.get(pk=self.p1.id)
          self.assertEqual(repr(r.place), '<Place: Demon Dogs the place>')
keep keep keep keep replace replace keep keep keep keep keep
 Merged one_to_one_regress into the one_to_one test package. 
tests/one_to_one/tests.py