MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _fixture

Method _fixture

test/ext/test_hybrid.py:1032–1062  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1030 __dialect__ = "default"
1031
1032 def _fixture(self):
1033 Base = declarative_base()
1034
1035 class A(Base):
1036 __tablename__ = "a"
1037 id = Column(Integer, primary_key=True)
1038 _value = Column("value", String)
1039
1040 @hybrid.hybrid_property
1041 def value(self):
1042 return self._value
1043
1044 value_syn = synonym("value")
1045
1046 @hybrid.hybrid_property
1047 def string_value(self):
1048 return "foo"
1049
1050 string_value_syn = synonym("string_value")
1051
1052 @hybrid.hybrid_property
1053 def string_expr_value(self):
1054 return "foo"
1055
1056 @string_expr_value.expression
1057 def string_expr_value(cls):
1058 return literal_column("'foo'")
1059
1060 string_expr_value_syn = synonym("string_expr_value")
1061
1062 return A
1063
1064 def test_hasattr(self):
1065 A = self._fixture()

Callers 4

test_hasattrMethod · 0.95
test_instance_accessMethod · 0.95
test_expression_exprMethod · 0.95

Calls 1

declarative_baseFunction · 0.90

Tested by

no test coverage detected