MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_hybrids

Method test_hybrids

test/orm/dml/test_evaluator.py:306–324  ·  view source on GitHub ↗
(self, registry)

Source from the content-addressed store, hash-verified

304 )
305
306 def test_hybrids(self, registry):
307 @registry.mapped
308 class SomeClass:
309 __tablename__ = "sc"
310 id = Column(Integer, primary_key=True)
311 data = Column(String)
312
313 @hybrid_property
314 def foo_data(self):
315 return self.data + "_foo"
316
317 eval_eq(
318 SomeClass.foo_data == "somedata_foo",
319 testcases=[
320 (SomeClass(data="somedata"), True),
321 (SomeClass(data="otherdata"), False),
322 (SomeClass(data=None), None),
323 ],
324 )
325
326 def test_custom_op_no_impl(self):
327 """test #3162"""

Callers

nothing calls this directly

Calls 2

eval_eqFunction · 0.85
SomeClassClass · 0.70

Tested by

no test coverage detected