Skip to content

Commit

Permalink
Tests for _col/_nocol against SQL views, refs #615
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed May 27, 2021
1 parent 3d8598b commit 387c837
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_api.py
Expand Up @@ -2041,6 +2041,11 @@ def test_http_options_request(app_client):
"/fixtures/facetable.json?_col=state&_col=created&_nocol=created",
["pk", "state"],
),
(
"/fixtures/simple_view.json?_nocol=content",
["upper_content"],
),
("/fixtures/simple_view.json?_col=content", ["content"]),
),
)
def test_col_nocol(app_client, path, expected_columns):
Expand All @@ -2056,6 +2061,7 @@ def test_col_nocol(app_client, path, expected_columns):
("/fixtures/facetable.json?_col=bad", "_col=bad - invalid columns"),
("/fixtures/facetable.json?_nocol=bad", "_nocol=bad - invalid columns"),
("/fixtures/facetable.json?_nocol=pk", "_nocol=pk - invalid columns"),
("/fixtures/simple_view.json?_col=bad", "_col=bad - invalid columns"),
),
)
def test_col_nocol_errors(app_client, path, expected_error):
Expand Down

0 comments on commit 387c837

Please sign in to comment.