| 507 | ) |
| 508 | |
| 509 | def test_reflush(self): |
| 510 | T2, T3, T1 = (self.classes.T2, self.classes.T3, self.classes.T1) |
| 511 | |
| 512 | o1 = T1() |
| 513 | o1.t2 = T2() |
| 514 | sess = fixture_session() |
| 515 | sess.add(o1) |
| 516 | sess.flush() |
| 517 | |
| 518 | # the bug here is that the dependency sort comes up with T1/T2 in a |
| 519 | # cycle, but there are no T1/T2 objects to be saved. therefore no |
| 520 | # "cyclical subtree" gets generated, and one or the other of T1/T2 |
| 521 | # gets lost, and processors on T3 don't fire off. the test will then |
| 522 | # fail because the FK's on T3 are not nullable. |
| 523 | o3 = T3() |
| 524 | o3.t1 = o1 |
| 525 | o3.t2 = o1.t2 |
| 526 | sess.add(o3) |
| 527 | sess.flush() |
| 528 | |
| 529 | def test_reflush_2(self): |
| 530 | """A variant on test_reflush()""" |