summaryrefslogtreecommitdiff
path: root/test/base
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-02-25 13:20:43 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-02-25 13:20:43 -0500
commita7f766d7c7fd6c53eb0019e32569e915b3f31eb4 (patch)
tree25f6234f67bbea40bb95eb34572bd2f67136e33f /test/base
parent34d6c9bc7dafbb2717ae10b6e11942e2dd409f35 (diff)
downloadsqlalchemy-a7f766d7c7fd6c53eb0019e32569e915b3f31eb4.tar.gz
- establish an "insert" option for events to control ordering if needed (not needed yet tho)
- render foreign key constraints in the order in which they were cerated
Diffstat (limited to 'test/base')
-rw-r--r--test/base/test_events.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/base/test_events.py b/test/base/test_events.py
index e894a1f74..f699a66f2 100644
--- a/test/base/test_events.py
+++ b/test/base/test_events.py
@@ -70,6 +70,25 @@ class TestEvents(TestBase):
eq_(len(Target().dispatch.event_one), 2)
eq_(len(t1.dispatch.event_one), 3)
+ def test_append_vs_insert(self):
+ def listen_one(x, y):
+ pass
+
+ def listen_two(x, y):
+ pass
+
+ def listen_three(x, y):
+ pass
+
+ event.listen(Target, "event_one", listen_one)
+ event.listen(Target, "event_one", listen_two)
+ event.listen(Target, "event_one", listen_three, insert=True)
+
+ eq_(
+ list(Target().dispatch.event_one),
+ [listen_three, listen_one, listen_two]
+ )
+
class TestAcceptTargets(TestBase):
"""Test default target acceptance."""