diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2020-01-18 00:13:37 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-01-18 00:13:37 +0000 |
| commit | a54527fb0ef71aca0be9614617f143da27e03f22 (patch) | |
| tree | e80f6f1158f30deaa5e99b5376f013cc8602adb6 /test/sql | |
| parent | 9e31fc74089cf565df5f275d22eb8ae5414d6e45 (diff) | |
| parent | bdbe164d392d41991b64ced0f097930a04a2c420 (diff) | |
| download | sqlalchemy-a54527fb0ef71aca0be9614617f143da27e03f22.tar.gz | |
Merge "apply asbool reduction to the onclause in join()"
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_operators.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index aa56d0b6b..a90b03b38 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -5,6 +5,7 @@ from sqlalchemy import and_ from sqlalchemy import between from sqlalchemy import exc from sqlalchemy import Integer +from sqlalchemy import join from sqlalchemy import LargeBinary from sqlalchemy import literal_column from sqlalchemy import not_ @@ -988,6 +989,42 @@ class BooleanEvalTest(fixtures.TestBase, testing.AssertsCompiledSQL): or_(false(), true()), "1 = 1", dialect=self._dialect(False) ) + def test_seven_a(self): + t1 = table("t1", column("a")) + t2 = table("t2", column("b")) + self.assert_compile( + join(t1, t2, onclause=true()), + "t1 JOIN t2 ON 1 = 1", + dialect=self._dialect(False), + ) + + def test_seven_b(self): + t1 = table("t1", column("a")) + t2 = table("t2", column("b")) + self.assert_compile( + join(t1, t2, onclause=false()), + "t1 JOIN t2 ON 0 = 1", + dialect=self._dialect(False), + ) + + def test_seven_c(self): + t1 = table("t1", column("a")) + t2 = table("t2", column("b")) + self.assert_compile( + join(t1, t2, onclause=true()), + "t1 JOIN t2 ON true", + dialect=self._dialect(True), + ) + + def test_seven_d(self): + t1 = table("t1", column("a")) + t2 = table("t2", column("b")) + self.assert_compile( + join(t1, t2, onclause=false()), + "t1 JOIN t2 ON false", + dialect=self._dialect(True), + ) + def test_eight(self): self.assert_compile( and_(false(), true()), "false", dialect=self._dialect(True) |
