| 2953 | assert not t2.select().alias("foo").is_derived_from(t1) |
| 2954 | |
| 2955 | def test_join(self): |
| 2956 | meta = MetaData() |
| 2957 | |
| 2958 | t1 = Table( |
| 2959 | "t1", |
| 2960 | meta, |
| 2961 | Column("c1", Integer, primary_key=True), |
| 2962 | Column("c2", String(30)), |
| 2963 | ) |
| 2964 | t2 = Table( |
| 2965 | "t2", |
| 2966 | meta, |
| 2967 | Column("c1", Integer, primary_key=True), |
| 2968 | Column("c2", String(30)), |
| 2969 | ) |
| 2970 | t3 = Table( |
| 2971 | "t3", |
| 2972 | meta, |
| 2973 | Column("c1", Integer, primary_key=True), |
| 2974 | Column("c2", String(30)), |
| 2975 | ) |
| 2976 | |
| 2977 | j1 = t1.join(t2, t1.c.c1 == t2.c.c1) |
| 2978 | |
| 2979 | assert j1.is_derived_from(j1) |
| 2980 | |
| 2981 | assert j1.is_derived_from(t1) |
| 2982 | |
| 2983 | assert j1._annotate({"foo": "bar"}).is_derived_from(j1) |
| 2984 | |
| 2985 | assert not j1.is_derived_from(t3) |
| 2986 | |
| 2987 | |
| 2988 | class AnnotationsTest(fixtures.TestBase): |