summaryrefslogtreecommitdiff
path: root/test/sql/test_metadata.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-07-24 17:37:25 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2016-07-24 23:17:11 -0400
commit2c8643b0e98070bbf51bc38d32258526634ee67d (patch)
treeb7aee41d45e0f6964060abd2a219d9165743555f /test/sql/test_metadata.py
parent96c4208bf83607120d2f716070ed22ee10312dd0 (diff)
downloadsqlalchemy-2c8643b0e98070bbf51bc38d32258526634ee67d.tar.gz
Allow Table._reset_exported to silently pass
Fixed bug in :class:`.Table` where the internal method ``_reset_exported()`` would corrupt the state of the object. This method is intended for selectable objects and is called by the ORM in some cases; an erroneous mapper configuration would could lead the ORM to call this on on a :class:`.Table` object. Change-Id: I63fa34ee0cdf16358bb125c556390df79758bcbc Fixes: #3755
Diffstat (limited to 'test/sql/test_metadata.py')
-rw-r--r--test/sql/test_metadata.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/sql/test_metadata.py b/test/sql/test_metadata.py
index 92d35e6e5..846e70589 100644
--- a/test/sql/test_metadata.py
+++ b/test/sql/test_metadata.py
@@ -1231,6 +1231,21 @@ class TableTest(fixtures.TestBase, AssertsCompiledSQL):
t.info['bar'] = 'zip'
assert t.info['bar'] == 'zip'
+ def test_reset_exported_passes(self):
+
+ m = MetaData()
+
+ t = Table('t', m, Column('foo', Integer))
+ eq_(
+ list(t.c), [t.c.foo]
+ )
+
+ t._reset_exported()
+
+ eq_(
+ list(t.c), [t.c.foo]
+ )
+
def test_foreign_key_constraints_collection(self):
metadata = MetaData()
t1 = Table('foo', metadata, Column('a', Integer))