~ubuntu-branches/debian/sid/sqlalchemy/sid

« back to all changes in this revision

Viewing changes to test/engine/test_reflection.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2012-03-15 21:05:49 UTC
  • mfrom: (1.4.19)
  • Revision ID: package-import@ubuntu.com-20120315210549-fiuynu6jue9keqlh
Tags: 0.7.6-1
* New upstream release
* debhelper's compatibility bumped to 7
* Standards-Version bumped to 3.9.3 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
        assert len(t2.indexes) == 2
204
204
 
205
205
    @testing.provide_metadata
206
 
    def test_autoload_replace(self):
 
206
    def test_autoload_replace_foreign_key(self):
207
207
        a = Table('a', self.metadata, Column('id', Integer, primary_key=True))
208
208
        b = Table('b', self.metadata, Column('id', Integer, primary_key=True),
209
209
                                    Column('a_id', Integer))
220
220
        assert b2.c.a_id.references(a2.c.id)
221
221
        eq_(len(b2.constraints), 2)
222
222
 
 
223
    @testing.provide_metadata
 
224
    def test_autoload_replace_primary_key(self):
 
225
        a = Table('a', self.metadata, Column('id', Integer))
 
226
        self.metadata.create_all()
 
227
 
 
228
        m2 = MetaData()
 
229
        a2 = Table('a', m2, Column('id', Integer, primary_key=True))
 
230
 
 
231
        Table('a', m2, autoload=True, autoload_with=testing.db,
 
232
                        autoload_replace=False, extend_existing=True)
 
233
        eq_(list(a2.primary_key), [a2.c.id])
 
234
 
223
235
    def test_autoload_replace_arg(self):
224
236
        Table('t', MetaData(), autoload_replace=False)
225
237