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

« back to all changes in this revision

Viewing changes to test/orm/test_cycles.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2014-06-27 20:17:13 UTC
  • mfrom: (1.4.28)
  • Revision ID: package-import@ubuntu.com-20140627201713-g6p1kq8q1qenztrv
Tags: 0.9.6-1
* New upstream release
* Remove Python 3.X build tag files, thanks to Matthias Urlichs for the
  patch (closes: #747852)
* python-fdb isn't in the Debian archive yet so default dialect for firebird://
  URLs is changed to obsolete kinterbasdb, thanks to Russell Stuart for the
  patch (closes: #752145)

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
    def define_tables(cls, metadata):
276
276
        Table('a', metadata,
277
277
            Column('id', Integer, primary_key=True, test_needs_autoincrement=True),
278
 
            Column('data', String(30)),
279
278
            Column('cid', Integer, ForeignKey('c.id')))
280
279
 
281
280
        Table('b', metadata,
282
281
            Column('id', Integer, ForeignKey("a.id"), primary_key=True),
283
 
            Column('data', String(30)))
 
282
            )
284
283
 
285
284
        Table('c', metadata,
286
285
            Column('id', Integer, primary_key=True, test_needs_autoincrement=True),
287
 
            Column('data', String(30)),
288
286
            Column('aid', Integer,
289
287
                   ForeignKey('a.id', use_alter=True, name="foo")))
290
288
 
383
381
        # the bug here is that the dependency sort comes up with T1/T2 in a
384
382
        # cycle, but there are no T1/T2 objects to be saved.  therefore no
385
383
        # "cyclical subtree" gets generated, and one or the other of T1/T2
386
 
        # gets lost, and processors on T3 dont fire off.  the test will then
 
384
        # gets lost, and processors on T3 don't fire off.  the test will then
387
385
        # fail because the FK's on T3 are not nullable.
388
386
        o3 = T3()
389
387
        o3.t1 = o1
592
590
 
593
591
    def test_cycle(self):
594
592
        """
595
 
        This test has a peculiar aspect in that it doesnt create as many
 
593
        This test has a peculiar aspect in that it doesn't create as many
596
594
        dependent relationships as the other tests, and revealed a small
597
595
        glitch in the circular dependency sorting.
598
596