summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-04-15 01:35:54 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-04-15 01:35:54 -0400
commit7cfd33d4ef9c00bcc2114469960590bdf22f8ac2 (patch)
tree359298aae841488e468a5f6d6c7ec7704ec74701 /test
parentadeacfaf1cfbcbc2188bce9a35251b990b753fa8 (diff)
downloadsqlalchemy-7cfd33d4ef9c00bcc2114469960590bdf22f8ac2.tar.gz
more test adjustments
Diffstat (limited to 'test')
-rw-r--r--test/orm/test_naturalpks.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/orm/test_naturalpks.py b/test/orm/test_naturalpks.py
index f81167062..a352e3b34 100644
--- a/test/orm/test_naturalpks.py
+++ b/test/orm/test_naturalpks.py
@@ -421,7 +421,8 @@ class ReversePKsTest(_base.MappedTest):
class SelfReferentialTest(_base.MappedTest):
- __unsupported_on__ = ('mssql',) # mssql doesn't allow ON UPDATE on self-referential keys
+ __unsupported_on__ = ('mssql','mysql') # mssql, mysql don't allow
+ # ON UPDATE on self-referential keys
@classmethod
def define_tables(cls, metadata):
@@ -433,7 +434,9 @@ class SelfReferentialTest(_base.MappedTest):
Table('nodes', metadata,
Column('name', String(50), primary_key=True),
Column('parent', String(50),
- ForeignKey('nodes.name', **fk_args)))
+ ForeignKey('nodes.name', **fk_args)),
+ test_needs_fk=True
+ )
@classmethod
def setup_classes(cls):
@@ -465,12 +468,20 @@ class SelfReferentialTest(_base.MappedTest):
for n in sess.query(Node).filter(
Node.name.in_(['n11', 'n12', 'n13']))])
+ @testing.fails_on('sqlite', 'sqlite doesnt support ON UPDATE CASCADE')
+ @testing.fails_on('oracle', 'oracle doesnt support ON UPDATE CASCADE')
+ def test_many_to_one_passive(self):
+ self._test_many_to_one(True)
+
+ def test_many_to_one_nonpassive(self):
+ self._test_many_to_one(False)
+
@testing.resolve_artifact_names
- def test_many_to_one(self):
+ def _test_many_to_one(self, passive):
mapper(Node, nodes, properties={
'parentnode':relationship(Node,
remote_side=nodes.c.name,
- passive_updates=True)
+ passive_updates=passive)
}
)
@@ -484,6 +495,8 @@ class SelfReferentialTest(_base.MappedTest):
n1.name = 'new n1'
sess.flush()
+ if passive:
+ sess.expire_all()
eq_(['new n1', 'new n1', 'new n1'],
[n.parent
for n in sess.query(Node).filter(