test that the circular dependency sort can assemble a many-to-one dependency processor when only the object on the "many" side is actually in the list of modified objects.
(self)
| 95 | sess.flush() |
| 96 | |
| 97 | def test_many_to_one_only(self): |
| 98 | """ |
| 99 | |
| 100 | test that the circular dependency sort can assemble a many-to-one |
| 101 | dependency processor when only the object on the "many" side is |
| 102 | actually in the list of modified objects. |
| 103 | |
| 104 | """ |
| 105 | |
| 106 | C1, t1 = self.classes.C1, self.tables.t1 |
| 107 | |
| 108 | self.mapper_registry.map_imperatively( |
| 109 | C1, |
| 110 | t1, |
| 111 | properties={ |
| 112 | "parent": relationship( |
| 113 | C1, |
| 114 | primaryjoin=t1.c.parent_c1 == t1.c.c1, |
| 115 | remote_side=t1.c.c1, |
| 116 | ) |
| 117 | }, |
| 118 | ) |
| 119 | |
| 120 | c1 = C1() |
| 121 | |
| 122 | sess = fixture_session() |
| 123 | sess.add(c1) |
| 124 | sess.flush() |
| 125 | sess.expunge_all() |
| 126 | c1 = sess.get(C1, c1.c1) |
| 127 | c2 = C1() |
| 128 | c2.parent = c1 |
| 129 | sess.add(c2) |
| 130 | sess.flush() |
| 131 | assert c2.parent_c1 == c1.c1 |
| 132 | |
| 133 | def test_cycle(self): |
| 134 | C2, C1, t2, t1 = ( |
nothing calls this directly
no test coverage detected