MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_no_strings

Method test_no_strings

test/orm/test_query.py:5879–5892  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5877 __dialect__ = "default"
5878
5879 def test_no_strings(self):
5880 User = self.classes.User
5881
5882 sess = fixture_session()
5883 q = sess.query(User)
5884
5885 u1 = q.filter_by(name="jack").one()
5886
5887 with expect_raises_message(
5888 sa_exc.ArgumentError,
5889 r"with_parent\(\) accepts class-bound mapped "
5890 "attributes, not strings",
5891 ):
5892 with_parent(u1, "orders")
5893
5894 def test_o2m(self):
5895 User, Order = (

Callers

nothing calls this directly

Calls 6

fixture_sessionFunction · 0.90
expect_raises_messageFunction · 0.90
with_parentFunction · 0.90
queryMethod · 0.45
oneMethod · 0.45
filter_byMethod · 0.45

Tested by

no test coverage detected