summaryrefslogtreecommitdiff
path: root/test/orm/test_generative.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-10-15 23:00:06 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-10-15 23:00:06 +0000
commiteb6f1f87f6f632c16bde4b8e947f6e302e7c5c8b (patch)
treebb16d8805115990e603fe1da93251f93ef5f1c3e /test/orm/test_generative.py
parent53f1c775db8f58ed33f3e35bbb3bd36961442c0c (diff)
downloadsqlalchemy-eb6f1f87f6f632c16bde4b8e947f6e302e7c5c8b.tar.gz
deprecations per [ticket:1498]:
- deprecated PassiveDefault - use DefaultClause. - the BINARY and MSBinary types now generate "BINARY" in all cases. Omitting the "length" parameter will generate "BINARY" with no length. Use BLOB to generate an unlengthed binary column. - the "quoting='quoted'" argument to MSEnum/ENUM is deprecated. It's best to rely upon the automatic quoting. - "shortname" attribute on bindparam() is removed. - fold_equivalents flag on join is deprecated (will remain until [ticket:1131] is implemented) - "scalar" flag on select() is removed, use select.as_scalar(). - 'transactional' flag on sessionmaker() and others is removed. Use 'autocommit=True' to indicate 'transactional=False'. - 'polymorphic_fetch' argument on mapper() is removed. Loading can be controlled using the 'with_polymorphic' option. - 'select_table' argument on mapper() is removed. Use 'with_polymorphic=("*", <some selectable>)' for this functionality. - 'proxy' argument on synonym() is removed. This flag did nothing throughout 0.5, as the "proxy generation" behavior is now automatic. - Passing a single list of elements to eagerload(), eagerload_all(), contains_eager(), lazyload(), defer(), and undefer() instead of multiple positional -args is deprecated. - Passing a single list of elements to query.order_by(), query.group_by(), query.join(), or query.outerjoin() instead of multiple positional *args is deprecated. - query.iterate_instances() is removed. Use query.instances(). - Query.query_from_parent() is removed. Use the sqlalchemy.orm.with_parent() function to produce a "parent" clause, or alternatively query.with_parent(). - query._from_self() is removed, use query.from_self() instead. - the "comparator" argument to composite() is removed. Use "comparator_factory". - RelationProperty._get_join() is removed. - the 'echo_uow' flag on Session is removed. Use logging on the "sqlalchemy.orm.unitofwork" name. - session.clear() is removed. use session.expunge_all(). - session.save(), session.update(), session.save_or_update() are removed. Use session.add() and session.add_all(). - the "objects" flag on session.flush() remains deprecated. - the "dont_load=True" flag on session.merge() is deprecated in favor of "load=False". - passing an InstanceState (internal SQLAlchemy state object) to attributes.init_collection() or attributes.get_history() is deprecated. These functions are public API and normally expect a regular mapped object instance. - the 'engine' parameter to declarative_base() is removed. Use the 'bind' keyword argument.
Diffstat (limited to 'test/orm/test_generative.py')
-rw-r--r--test/orm/test_generative.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/orm/test_generative.py b/test/orm/test_generative.py
index 8f61d4d14..4274b4686 100644
--- a/test/orm/test_generative.py
+++ b/test/orm/test_generative.py
@@ -37,8 +37,8 @@ class GenerativeQueryTest(_base.MappedTest):
@testing.resolve_artifact_names
def test_selectby(self):
res = create_session().query(Foo).filter_by(range=5)
- assert res.order_by([Foo.bar])[0].bar == 5
- assert res.order_by([sa.desc(Foo.bar)])[0].bar == 95
+ assert res.order_by(Foo.bar)[0].bar == 5
+ assert res.order_by(sa.desc(Foo.bar))[0].bar == 95
@testing.fails_on('maxdb', 'FIXME: unknown')
@testing.resolve_artifact_names
@@ -134,13 +134,13 @@ class GenerativeQueryTest(_base.MappedTest):
@testing.resolve_artifact_names
def test_order_by(self):
query = create_session().query(Foo)
- assert query.order_by([Foo.bar])[0].bar == 0
- assert query.order_by([sa.desc(Foo.bar)])[0].bar == 99
+ assert query.order_by(Foo.bar)[0].bar == 0
+ assert query.order_by(sa.desc(Foo.bar))[0].bar == 99
@testing.resolve_artifact_names
def test_offset(self):
query = create_session().query(Foo)
- assert list(query.order_by([Foo.bar]).offset(10))[0].bar == 10
+ assert list(query.order_by(Foo.bar).offset(10))[0].bar == 10
@testing.resolve_artifact_names
def test_offset(self):
@@ -217,7 +217,7 @@ class RelationsTest(_fixtures.FixtureTest):
"""Query.join"""
session = create_session()
- q = (session.query(User).join(['orders', 'addresses']).
+ q = (session.query(User).join('orders', 'addresses').
filter(Address.id == 1))
eq_([User(id=7)], q.all())
@@ -226,7 +226,7 @@ class RelationsTest(_fixtures.FixtureTest):
"""Query.outerjoin"""
session = create_session()
- q = (session.query(User).outerjoin(['orders', 'addresses']).
+ q = (session.query(User).outerjoin('orders', 'addresses').
filter(sa.or_(Order.id == None, Address.id == 1)))
eq_(set([User(id=7), User(id=8), User(id=10)]),
set(q.all()))
@@ -237,7 +237,7 @@ class RelationsTest(_fixtures.FixtureTest):
session = create_session()
- q = (session.query(User).outerjoin(['orders', 'addresses']).
+ q = (session.query(User).outerjoin('orders', 'addresses').
filter(sa.or_(Order.id == None, Address.id == 1)))
eq_(q.count(), 4)