MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_fk_table

Method test_fk_table

test/sql/test_selectable.py:1907–1923  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1905 assert j.c.b_q is q
1906
1907 def test_fk_table(self):
1908 m = MetaData()
1909 fk = ForeignKey("x.id")
1910 Table("x", m, Column("id", Integer))
1911 a = Table("a", m, Column("x", Integer, fk))
1912 a.c
1913
1914 q = Column("q", Integer)
1915 a.append_column(q)
1916 a._refresh_for_new_column(q)
1917 eq_(a.foreign_keys, {fk})
1918
1919 fk2 = ForeignKey("g.id")
1920 p = Column("p", Integer, fk2)
1921 a.append_column(p)
1922 a._refresh_for_new_column(p)
1923 eq_(a.foreign_keys, {fk, fk2})
1924
1925 def test_fk_join(self):
1926 m = MetaData()

Callers

nothing calls this directly

Calls 7

append_columnMethod · 0.95
MetaDataClass · 0.90
ForeignKeyClass · 0.90
TableClass · 0.90
ColumnClass · 0.90
eq_Function · 0.90

Tested by

no test coverage detected