(self, q, sub_opt, non_sub_opts)
| 1384 | run_deletes = None |
| 1385 | |
| 1386 | def _assert_opts(self, q, sub_opt, non_sub_opts): |
| 1387 | attr_a = {} |
| 1388 | |
| 1389 | q1 = q.options(sub_opt)._compile_context() |
| 1390 | q2 = q.options(*non_sub_opts)._compile_context() |
| 1391 | |
| 1392 | attr_a = { |
| 1393 | k: v |
| 1394 | for k, v in q1.attributes.items() |
| 1395 | if isinstance(k, tuple) and k[0] == "loader" |
| 1396 | } |
| 1397 | attr_b = { |
| 1398 | k: v |
| 1399 | for k, v in q2.attributes.items() |
| 1400 | if isinstance(k, tuple) and k[0] == "loader" |
| 1401 | } |
| 1402 | |
| 1403 | def strat_as_tuple(strat): |
| 1404 | return ( |
| 1405 | strat.strategy, |
| 1406 | strat.local_opts, |
| 1407 | getattr(strat, "_of_type", None), |
| 1408 | strat.is_class_strategy, |
| 1409 | strat.is_opts_only, |
| 1410 | ) |
| 1411 | |
| 1412 | eq_( |
| 1413 | {path: strat_as_tuple(load) for path, load in attr_a.items()}, |
| 1414 | {path: strat_as_tuple(load) for path, load in attr_b.items()}, |
| 1415 | ) |
| 1416 | |
| 1417 | def test_one(self): |
| 1418 | User, Address, Order, Item, SubItem = self.classes( |
no test coverage detected