summaryrefslogtreecommitdiff
path: root/test/sql/test_text.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/sql/test_text.py')
-rw-r--r--test/sql/test_text.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_text.py b/test/sql/test_text.py
index 35d909ef8..9483d10b0 100644
--- a/test/sql/test_text.py
+++ b/test/sql/test_text.py
@@ -282,6 +282,19 @@ class BindParamTest(fixtures.TestBase, AssertsCompiledSQL):
dialect="postgresql",
)
+ def test_unique_binds(self):
+ # unique binds can be used in text() however they uniquify across
+ # multiple text() constructs only, not within a single text
+
+ t1 = text("select :foo").bindparams(bindparam("foo", 5, unique=True))
+ t2 = text("select :foo").bindparams(bindparam("foo", 10, unique=True))
+ stmt = select([t1, t2])
+ self.assert_compile(
+ stmt,
+ "SELECT select :foo_1, select :foo_2",
+ checkparams={"foo_1": 5, "foo_2": 10},
+ )
+
def test_binds_compiled_positional(self):
self.assert_compile(
text(