test that primary key reflection not tripped up by unique indexes
(self, connection, metadata)
| 1064 | eq_(getattr(fk, attr), getattr(ref, attr)) |
| 1065 | |
| 1066 | def test_pks_not_uniques(self, connection, metadata): |
| 1067 | """test that primary key reflection not tripped up by unique |
| 1068 | indexes""" |
| 1069 | |
| 1070 | conn = connection |
| 1071 | conn.exec_driver_sql(""" |
| 1072 | CREATE TABLE book ( |
| 1073 | id INTEGER NOT NULL, |
| 1074 | title VARCHAR(100) NOT NULL, |
| 1075 | series INTEGER, |
| 1076 | series_id INTEGER, |
| 1077 | UNIQUE(series, series_id), |
| 1078 | PRIMARY KEY(id) |
| 1079 | )""") |
| 1080 | |
| 1081 | book = Table("book", metadata, autoload_with=connection) |
| 1082 | assert book.primary_key.contains_column(book.c.id) |
| 1083 | assert not book.primary_key.contains_column(book.c.series) |
| 1084 | eq_(len(book.primary_key), 1) |
| 1085 | |
| 1086 | def test_fk_error(self, connection, metadata): |
| 1087 | Table( |
nothing calls this directly
no test coverage detected