You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by yo...@apache.org on 2022/01/28 07:04:09 UTC

[superset] 10/10: add ut

This is an automated email from the ASF dual-hosted git repository.

yongjiezhao pushed a commit to branch pull/17881
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 7d23b2599a9324c5812805f3343810ca8e29f4a0
Author: stephenLYZ <75...@qq.com>
AuthorDate: Wed Jan 26 22:08:49 2022 +0800

    add ut
---
 tests/integration_tests/sqla_models_tests.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/tests/integration_tests/sqla_models_tests.py b/tests/integration_tests/sqla_models_tests.py
index 105316d..2c12620 100644
--- a/tests/integration_tests/sqla_models_tests.py
+++ b/tests/integration_tests/sqla_models_tests.py
@@ -550,6 +550,29 @@ class TestDatabaseModel(SupersetTestCase):
         )
         assert result_object.df["count"][0] == 4
 
+    def test_values_in_quotes(self):
+        table = SqlaTable(
+            table_name="test_quotes_in_column",
+            sql=(
+                "SELECT '\"text in double quotes\"' as name "
+                "UNION SELECT '''text in single quotes''' "
+                "UNION SELECT 'double quotes \" in text' "
+                "UNION SELECT 'single quotes '' in text' "
+            ),
+            database=get_example_database(),
+        )
+        TableColumn(column_name="name", type="VARCHAR(255)", table=table)
+
+        rv = table.values_for_column(column_name="name", limit=10000,)
+
+        for item in [
+            '"text in double quotes"',
+            "'text in single quotes'",
+            'double quotes " in text',
+            "single quotes ' in text",
+        ]:
+            assert item in rv
+
 
 @pytest.mark.parametrize(
     "row,dimension,result",