(self)
| 66 | self.data = data |
| 67 | |
| 68 | def test_single(self): |
| 69 | C1, t1 = self.classes.C1, self.tables.t1 |
| 70 | |
| 71 | self.mapper_registry.map_imperatively( |
| 72 | C1, |
| 73 | t1, |
| 74 | properties={ |
| 75 | "c1s": relationship( |
| 76 | C1, cascade="all", back_populates="parent" |
| 77 | ), |
| 78 | "parent": relationship( |
| 79 | C1, |
| 80 | primaryjoin=t1.c.parent_c1 == t1.c.c1, |
| 81 | remote_side=t1.c.c1, |
| 82 | lazy="select", |
| 83 | uselist=False, |
| 84 | back_populates="c1s", |
| 85 | ), |
| 86 | }, |
| 87 | ) |
| 88 | a = C1("head c1") |
| 89 | a.c1s.append(C1("another c1")) |
| 90 | |
| 91 | sess = fixture_session() |
| 92 | sess.add(a) |
| 93 | sess.flush() |
| 94 | sess.delete(a) |
| 95 | sess.flush() |
| 96 | |
| 97 | def test_many_to_one_only(self): |
| 98 | """ |
nothing calls this directly
no test coverage detected