| | 269 | |
| | 270 | def test_autoload_mixed(self): |
| | 271 | # mixed autoloaded entity with a non autoloaded one |
| | 272 | conn = metadata.bind.connect() |
| | 273 | conn.execute("CREATE TABLE user (" |
| | 274 | "user_id INTEGER PRIMARY KEY AUTOINCREMENT)") |
| | 275 | conn.close() |
| | 276 | |
| | 277 | class User(Entity): |
| | 278 | using_options(tablename='user', autoload=True) |
| | 279 | |
| | 280 | class Item(Entity): |
| | 281 | using_options(autoload=False) |
| | 282 | |
| | 283 | owner = ManyToOne('User') |
| | 284 | |
| | 285 | setup_all(True) |
| | 286 | |
| | 287 | colname = Item.table.c['owner_user_id'].foreign_keys[0].column.name |
| | 288 | assert colname == 'user_id' |
| | 289 | |