(self, fixture, lazy)
| 1107 | |
| 1108 | @testing.combinations(("select",), ("raise",), argnames="lazy") |
| 1109 | def test_ignores_user(self, fixture, lazy): |
| 1110 | A, B = fixture() |
| 1111 | |
| 1112 | sess = fixture_session() |
| 1113 | |
| 1114 | a1 = A(email="x") |
| 1115 | b1 = B(user=a1) |
| 1116 | sess.add_all([a1, b1]) |
| 1117 | sess.commit() |
| 1118 | |
| 1119 | b1 = sess.execute(select(B)).scalars().first() |
| 1120 | |
| 1121 | sess.delete(b1) |
| 1122 | |
| 1123 | self.assert_sql_execution( |
| 1124 | testing.db, |
| 1125 | sess.flush, |
| 1126 | # we would like it to be able to skip this SELECT but this is not |
| 1127 | # implemented right now |
| 1128 | CompiledSQL( |
| 1129 | "SELECT a.id, a.email FROM a " "WHERE a.email = :param_1", |
| 1130 | [{"param_1": "x"}], |
| 1131 | ), |
| 1132 | CompiledSQL( |
| 1133 | "DELETE FROM b WHERE b.id = :id", lambda ctx: [{"id": 1}] |
| 1134 | ), |
| 1135 | ) |
| 1136 | |
| 1137 | |
| 1138 | class NoSaveCascadeFlushTest(_fixtures.FixtureTest): |
nothing calls this directly
no test coverage detected