MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_wp_joins

Method test_wp_joins

test/orm/test_cache_key.py:748–782  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

746 )
747
748 def test_wp_joins(self):
749 Company, Person, Manager, Engineer, Boss = self.classes(
750 "Company", "Person", "Manager", "Engineer", "Boss"
751 )
752
753 def one():
754 return (
755 fixture_session()
756 .query(Company)
757 .join(Company.employees)
758 .filter(Person.name == "asdf")
759 )
760
761 def two():
762 wp = with_polymorphic(Person, [Manager, Engineer])
763 return (
764 fixture_session()
765 .query(Company)
766 .join(Company.employees.of_type(wp))
767 .filter(wp.name == "asdf")
768 )
769
770 def three():
771 wp = with_polymorphic(Person, [Manager, Engineer])
772 return (
773 fixture_session()
774 .query(Company)
775 .join(Company.employees.of_type(wp))
776 .filter(wp.Engineer.name == "asdf")
777 )
778
779 self._run_cache_key_fixture(
780 lambda: stmt_20(one(), two(), three()),
781 compare_values=True,
782 )
783
784 @testing.variation(
785 "exprtype", ["plain_column", "self_standing_case", "case_w_columns"]

Callers

nothing calls this directly

Calls 2

stmt_20Function · 0.85

Tested by

no test coverage detected