Index: tests/modeltests/one_to_one/tests.py
===================================================================
--- tests/modeltests/one_to_one/tests.py	(revision 17238)
+++ tests/modeltests/one_to_one/tests.py	(working copy)
@@ -121,3 +121,11 @@
         mm = MultiModel(link1=self.p2, link2=o1, name="x1")
         self.assertRaises(IntegrityError, mm.save)
         transaction.savepoint_rollback(sid)
+
+    def test_attribute_caching(self):
+        # must do a query
+        self.assertRaises(Restaurant.DoesNotExist, getattr, self.p2, 'restaurant')
+
+        # accessing the same attribute again should not do a query
+        with self.assertNumQueries(0):
+            self.assertRaises(Restaurant.DoesNotExist, getattr, self.p2, 'restaurant')
