MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_pk_always_flips_nullable

Method test_pk_always_flips_nullable

test/sql/test_metadata.py:2257–2272  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2255 eq_(list(t.primary_key), [t.c.b, t.c.c])
2256
2257 def test_pk_always_flips_nullable(self):
2258 m = MetaData()
2259
2260 t1 = Table("t1", m, Column("x", Integer), PrimaryKeyConstraint("x"))
2261
2262 t2 = Table("t2", m, Column("x", Integer, primary_key=True))
2263
2264 eq_(list(t1.primary_key), [t1.c.x])
2265
2266 eq_(list(t2.primary_key), [t2.c.x])
2267
2268 assert t1.c.x.primary_key
2269 assert t2.c.x.primary_key
2270
2271 assert not t2.c.x.nullable
2272 assert not t1.c.x.nullable
2273
2274 def test_pk_can_be_nullable(self):
2275 m = MetaData()

Callers

nothing calls this directly

Calls 5

MetaDataClass · 0.90
TableClass · 0.90
ColumnClass · 0.90
eq_Function · 0.90

Tested by

no test coverage detected