(self, autoflush, persistent_fixture)
| 2103 | |
| 2104 | @testing.combinations(True, False, argnames="autoflush") |
| 2105 | def test_replace_persistent(self, autoflush, persistent_fixture): |
| 2106 | User = self.classes.User |
| 2107 | Address = self.classes.Address |
| 2108 | |
| 2109 | u1, a1, s = persistent_fixture(autoflush=autoflush) |
| 2110 | a2, a3, a4, a5 = ( |
| 2111 | Address(email_address="a2"), |
| 2112 | Address(email_address="a3"), |
| 2113 | Address(email_address="a4"), |
| 2114 | Address(email_address="a5"), |
| 2115 | ) |
| 2116 | |
| 2117 | if User.addresses.property.lazy == "write_only": |
| 2118 | with self._expect_no_iteration(): |
| 2119 | u1.addresses = [a1, a2] |
| 2120 | return |
| 2121 | |
| 2122 | u1.addresses = [a1, a2] |
| 2123 | u1.addresses = [a2, a3, a4, a5] |
| 2124 | |
| 2125 | if not autoflush: |
| 2126 | self._assert_history(u1, ([a2, a3, a4, a5], [], [])) |
| 2127 | else: |
| 2128 | self._assert_history( |
| 2129 | u1, |
| 2130 | ([a3, a4, a5], [a2], [a1]), |
| 2131 | compare_passive=([a3, a4, a5], [], [a1]), |
| 2132 | ) |
| 2133 | |
| 2134 | @testing.combinations(True, False, argnames="autoflush") |
| 2135 | def test_persistent_but_readded(self, autoflush, persistent_fixture): |
nothing calls this directly
no test coverage detected