summaryrefslogtreecommitdiff
path: root/test/orm/test_scoping.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-07-03 15:31:29 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-07-03 15:31:29 +0000
commitc2108dafbde1b99b660350b5b17018c63c785ee1 (patch)
treee265c10eca951478a9717e186eb1d584bf354caa /test/orm/test_scoping.py
parent41bc4d877f09eac7b408155cf17a8a216a7ace97 (diff)
downloadsqlalchemy-c2108dafbde1b99b660350b5b17018c63c785ee1.tar.gz
Session.mapper is now *deprecated*.
Call session.add() if you'd like a free-standing object to be part of your session. Otherwise, a DIY version of Session.mapper is now documented at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper The method will remain deprecated throughout 0.6. M test/ext/test_declarative.py M test/orm/test_scoping.py M lib/sqlalchemy/orm/scoping.py M CHANGES
Diffstat (limited to 'test/orm/test_scoping.py')
-rw-r--r--test/orm/test_scoping.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/orm/test_scoping.py b/test/orm/test_scoping.py
index 2117e8dcc..9f2f59e19 100644
--- a/test/orm/test_scoping.py
+++ b/test/orm/test_scoping.py
@@ -96,6 +96,7 @@ class ScopedMapperTest(_ScopedTest):
pass
@classmethod
+ @testing.uses_deprecated()
@testing.resolve_artifact_names
def setup_mappers(cls):
Session = scoped_session(sa.orm.create_session)
@@ -122,6 +123,7 @@ class ScopedMapperTest(_ScopedTest):
sso = SomeOtherObject.query().first()
assert SomeObject.query.filter_by(id=1).one().options[0].id == sso.id
+ @testing.uses_deprecated()
@testing.resolve_artifact_names
def test_query_compiles(self):
class Foo(object):
@@ -141,6 +143,7 @@ class ScopedMapperTest(_ScopedTest):
Session.mapper(Baz, table2, extension=ext)
assert hasattr(Baz, 'query')
+ @testing.uses_deprecated()
@testing.resolve_artifact_names
def test_default_constructor_state_not_shared(self):
scope = scoped_session(sa.orm.sessionmaker())
@@ -171,6 +174,7 @@ class ScopedMapperTest(_ScopedTest):
assert_raises(TypeError, C, foo='bar')
D(foo='bar')
+ @testing.uses_deprecated()
@testing.resolve_artifact_names
def test_validating_constructor(self):
s2 = SomeObject(someid=12)
@@ -183,6 +187,7 @@ class ScopedMapperTest(_ScopedTest):
assert_raises(sa.exc.ArgumentError, ValidatedOtherObject,
someid=12, bogus=345)
+ @testing.uses_deprecated()
@testing.resolve_artifact_names
def test_dont_clobber_methods(self):
class MyClass(object):
@@ -215,6 +220,7 @@ class ScopedMapperTest2(_ScopedTest):
pass
@classmethod
+ @testing.uses_deprecated()
@testing.resolve_artifact_names
def setup_mappers(cls):
Session = scoped_session(sa.orm.sessionmaker())