| 2928 | assert not t1.is_derived_from(t2.alias()) |
| 2929 | |
| 2930 | def test_select(self): |
| 2931 | meta = MetaData() |
| 2932 | |
| 2933 | t1 = Table( |
| 2934 | "t1", |
| 2935 | meta, |
| 2936 | Column("c1", Integer, primary_key=True), |
| 2937 | Column("c2", String(30)), |
| 2938 | ) |
| 2939 | t2 = Table( |
| 2940 | "t2", |
| 2941 | meta, |
| 2942 | Column("c1", Integer, primary_key=True), |
| 2943 | Column("c2", String(30)), |
| 2944 | ) |
| 2945 | |
| 2946 | assert t1.select().is_derived_from(t1) |
| 2947 | assert not t2.select().is_derived_from(t1) |
| 2948 | |
| 2949 | assert select(t1, t2).is_derived_from(t1) |
| 2950 | |
| 2951 | assert t1.select().alias("foo").is_derived_from(t1) |
| 2952 | assert select(t1, t2).alias("foo").is_derived_from(t1) |
| 2953 | assert not t2.select().alias("foo").is_derived_from(t1) |
| 2954 | |
| 2955 | def test_join(self): |
| 2956 | meta = MetaData() |