Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud committed Mar 10, 2021
1 parent cc2b529 commit cf80968
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/fixtures/query_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"filters": [
{"col": "gender", "op": "==", "val": "boy"},
{"col": "num", "op": "IS NOT NULL"},
{"col": "name", "op": "NOT IN", "val": ["<NULL>", "\"abc\""]},
{"col": "name", "op": "NOT IN", "val": ["<NULL>", '"abc"']},
],
"having": "",
"having_filters": [],
Expand Down
9 changes: 6 additions & 3 deletions tests/query_context_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import re

import pytest

from superset import db
Expand Down Expand Up @@ -308,9 +310,10 @@ def test_query_response_type(self):
sql_text = response["query"]
assert response["language"] == "sql"
assert "SELECT" in sql_text
assert "num IS NOT NULL" in sql_text
assert "NOT (name IS NULL" in sql_text
assert "OR name IN ('abc'))" in sql_text
assert re.search(r'"?num"? IS NOT NULL', sql_text)
assert re.search(
r"""NOT \("?name"? IS NULL[\s\n]* OR "?name"? IN \('abc'\)\)""", sql_text
)

@pytest.mark.usefixtures("load_birth_names_dashboard_with_slices")
def test_fetch_values_predicate_in_query(self):
Expand Down

0 comments on commit cf80968

Please sign in to comment.