diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-01 09:26:36 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-02-01 09:26:36 -0500 |
commit | 54cc2aa18c5e7db8b8121969e67b8e18f3c2362b (patch) | |
tree | 173fed5b5f2d8cf04619212a7c169942b09a3fe2 /test/lib/schema.py | |
parent | 12073e281eebdece0fe4e24c6704d57eafdc9247 (diff) | |
download | sqlalchemy-54cc2aa18c5e7db8b8121969e67b8e18f3c2362b.tar.gz |
- schema.copy() functions will copy dispatch, but only for those events
added with propagate=True. needs tests
- oracle/fb test schema uses event w/ propagate=True to apply
Sequence to primary key columns with test_needs_autoincrement.
this does actually test the propagate=True flag a bit since it's
needed in the declarative mixin tests where the 'id' column
is copied.
Diffstat (limited to 'test/lib/schema.py')
-rw-r--r-- | test/lib/schema.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lib/schema.py b/test/lib/schema.py index b4aabfe76..0cd38bc64 100644 --- a/test/lib/schema.py +++ b/test/lib/schema.py @@ -3,7 +3,7 @@ desired state for different backends. """ from test.lib import testing -from sqlalchemy import schema +from sqlalchemy import schema, event __all__ = 'Table', 'Column', @@ -64,11 +64,11 @@ def Column(*args, **kw): if 'test_needs_autoincrement' in test_opts and \ kw.get('primary_key', False) and \ testing.against('firebird', 'oracle'): - def add_seq(tbl, c): + def add_seq(c, tbl): c._init_items( schema.Sequence(_truncate_name(testing.db.dialect, tbl.name + '_' + c.name + '_seq'), optional=True) ) - col._on_table_attach(add_seq) + event.listen(col, 'after_parent_attach', add_seq, propagate=True) return col def _truncate_name(dialect, name): |