diff --git a/tests/regressiontests/one_to_one_regress/tests.py b/tests/regressiontests/one_to_one_regress/tests.py
index 88980c2..859c410 100644
a
|
b
|
class OneToOneRegressionTests(TestCase):
|
132 | 132 | Target.objects.exclude(pointer2=None), |
133 | 133 | [] |
134 | 134 | ) |
| 135 | |
| 136 | def test_one_to_one_backref_cache(self): |
| 137 | """ |
| 138 | Test that when an object is fetched through a 1-to-1 relation, |
| 139 | the back-reference is cached on the newly fetched object |
| 140 | """ |
| 141 | # Look up the objects again so that we get "fresh" objects |
| 142 | r = Restaurant.objects.get(pk = self.r1.pk) |
| 143 | p = r.place |
| 144 | r2 = p.restaurant |
| 145 | self.assertIs(r, r2) |
| 146 | |
| 147 | def test_one_to_one_reverse_backref_cache(self): |
| 148 | """ |
| 149 | Test that when an object is fetched through the reverse of a 1-to-1 relation, |
| 150 | the reverse back-reference (really, forward-reference) is cached |
| 151 | on the newly fetched object |
| 152 | """ |
| 153 | # Look up the objects again so that we get "fresh" objects |
| 154 | p = Place.objects.get(name="Demon Dogs") |
| 155 | r = p.restaurant |
| 156 | p2 = r.place |
| 157 | self.assertIs(p, p2) |