MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_from_base_to_subclass_attr

Method test_from_base_to_subclass_attr

test/orm/test_options.py:592–609  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

590
591 @emits_warning("This declarative base already contains a class")
592 def test_from_base_to_subclass_attr(self):
593 Dingaling, Address = self.classes.Dingaling, self.classes.Address
594
595 sess = fixture_session()
596
597 class SubAddr(Address):
598 pass
599
600 self.mapper_registry.map_imperatively(
601 SubAddr,
602 inherits=Address,
603 properties={"flub": relationship(Dingaling, viewonly=True)},
604 )
605
606 q = sess.query(Address)
607 opt = self._option_fixture(SubAddr.flub)
608
609 self._assert_path_result(opt, q, [(SubAddr, "flub")])
610
611 @emits_warning("This declarative base already contains a class")
612 def test_from_subclass_to_subclass_attr(self):

Callers

nothing calls this directly

Calls 6

_option_fixtureMethod · 0.95
fixture_sessionFunction · 0.90
relationshipFunction · 0.90
map_imperativelyMethod · 0.80
_assert_path_resultMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected