Skip to content

Commit

Permalink
Weird logical differentes between pgsql and sqlte❔
Browse files Browse the repository at this point in the history
  • Loading branch information
Kezzsim committed Dec 15, 2023
1 parent 39b78ff commit 4953113
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tiled/_tests/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,19 @@ def test_in(client, query_values):
],
)
def test_notin(client, query_values):
# TODO: Postgres and SQlite ACTUALLY treat this query differently in external testing.
# SQLite WILL NOT include fields that do not have the key, which is correct.
# Postgres WILL include fields that do not have the key,
# because by extension they do not have the value. Also correct. Why?
assert sorted(list(client.search(NotIn("letter", query_values)))) == sorted(
list(set(list(mapping.keys())) - set(["a", "k", "z"]))
list(
set(
list(mapping.keys())
if client.metadata["backend"] == "postgresql"
else keys
)
- set(["a", "k", "z"])
)
)


Expand Down

0 comments on commit 4953113

Please sign in to comment.