MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_select_flags

Method test_select_flags

test/orm/test_events.py:917–960  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

915 )
916
917 def test_select_flags(self):
918 User, Address = self.classes("User", "Address")
919
920 sess = Session(testing.db, future=True)
921
922 canary = self._flag_fixture(sess)
923
924 u1 = sess.execute(select(User).filter_by(id=7)).scalar_one()
925
926 sess.expire(u1)
927
928 eq_(u1.name, "jack")
929
930 eq_(
931 canary.mock_calls,
932 [
933 call.options(
934 bind_mapper=inspect(User),
935 all_mappers=[inspect(User)],
936 is_select=True,
937 is_from_statement=False,
938 is_insert=False,
939 is_update=False,
940 is_delete=False,
941 is_orm_statement=True,
942 is_relationship_load=False,
943 is_column_load=False,
944 lazy_loaded_from=None,
945 ),
946 call.options(
947 bind_mapper=inspect(User),
948 all_mappers=[inspect(User)],
949 is_select=True,
950 is_from_statement=False,
951 is_insert=False,
952 is_update=False,
953 is_delete=False,
954 is_orm_statement=True,
955 is_relationship_load=False,
956 is_column_load=True,
957 lazy_loaded_from=None,
958 ),
959 ],
960 )
961
962 def test_select_from_statement_flags(self):
963 User, Address = self.classes("User", "Address")

Callers

nothing calls this directly

Calls 10

_flag_fixtureMethod · 0.95
executeMethod · 0.95
expireMethod · 0.95
SessionClass · 0.90
selectFunction · 0.90
eq_Function · 0.90
inspectFunction · 0.90
scalar_oneMethod · 0.45
filter_byMethod · 0.45
optionsMethod · 0.45

Tested by

no test coverage detected