summaryrefslogtreecommitdiff
path: root/test/orm/lazy_relations.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-11-18 02:13:56 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-11-18 02:13:56 +0000
commit622a26a6551a3580c844b634519ab963c7f35aaf (patch)
tree24f6a07624805a26a8b7ae689df9181d41d19067 /test/orm/lazy_relations.py
parente076169d390df8a9e90aa46053db34fd5815598a (diff)
downloadsqlalchemy-622a26a6551a3580c844b634519ab963c7f35aaf.tar.gz
- session.refresh() and session.expire() now support an additional argument
"attribute_names", a list of individual attribute keynames to be refreshed or expired, allowing partial reloads of attributes on an already-loaded instance. - finally simplified the behavior of deferred attributes, deferred polymorphic load, session.refresh, session.expire, mapper._postfetch to all use a single codepath through query._get(), which now supports a list of individual attribute names to be refreshed. the *one* exception still remaining is mapper._get_poly_select_loader(), which may stay that way since its inline with an already processing load operation. otherwise, query._get() is the single place that all "load this instance's row" operation proceeds. - cleanup all over the place
Diffstat (limited to 'test/orm/lazy_relations.py')
-rw-r--r--test/orm/lazy_relations.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/test/orm/lazy_relations.py b/test/orm/lazy_relations.py
index b8e92c163..97eda3006 100644
--- a/test/orm/lazy_relations.py
+++ b/test/orm/lazy_relations.py
@@ -8,12 +8,10 @@ from testlib import *
from testlib.fixtures import *
from query import QueryTest
-class LazyTest(QueryTest):
+class LazyTest(FixtureTest):
keep_mappers = False
-
- def setup_mappers(self):
- pass
-
+ keep_data = True
+
def test_basic(self):
mapper(User, users, properties={
'addresses':relation(mapper(Address, addresses), lazy=True)
@@ -275,13 +273,10 @@ class LazyTest(QueryTest):
assert a.user is u1
-class M2OGetTest(QueryTest):
+class M2OGetTest(FixtureTest):
keep_mappers = False
- keep_data = False
+ keep_data = True
- def setup_mappers(self):
- pass
-
def test_m2o_noload(self):
"""test that a NULL foreign key doesn't trigger a lazy load"""
mapper(User, users)