Skip to content

Commit 9d0883b

Browse files
committed
test triage and rhs json handle.
1 parent d5add56 commit 9d0883b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

django_mongodb/features.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ def django_test_expected_failures(self):
245245
"expressions_case.tests.CaseExpressionTests.test_order_by_conditional_implicit",
246246
# annotate().filter().count() gives incorrect results.
247247
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_year_exact_lookup",
248+
"model_fields.test_jsonfield.TestQuerying.test_nested_key_transform_on_subquery",
249+
"model_fields.test_jsonfield.TestQuerying.test_ordering_grouping_by_count",
250+
"model_fields.test_jsonfield.TestQuerying.test_obj_subquery_lookup",
248251
},
249252
"Count doesn't work in QuerySet.annotate()": {
250253
"annotations.tests.AliasTests.test_alias_annotate_with_aggregation",
@@ -339,6 +342,10 @@ def django_test_expected_failures(self):
339342
"update.tests.SimpleTest.test_empty_update_with_inheritance",
340343
"update.tests.SimpleTest.test_foreign_key_update_with_id",
341344
"update.tests.SimpleTest.test_nonempty_update_with_inheritance",
345+
"model_fields.test_jsonfield.TestQuerying.test_ordering_grouping_by_key_transform",
346+
"model_fields.test_jsonfield.TestQuerying.test_ordering_by_transform",
347+
"model_fields.test_jsonfield.TestQuerying.test_order_grouping_custom_decoder",
348+
"model_fields.test_jsonfield.TestQuerying.test_join_key_transform_annotation_expression",
342349
},
343350
"Test inspects query for SQL": {
344351
"lookup.tests.LookupTests.test_in_ignore_none",
@@ -353,6 +360,9 @@ def django_test_expected_failures(self):
353360
"timezones.tests.NewDatabaseTests.test_cursor_execute_returns_naive_datetime",
354361
"timezones.tests.NewDatabaseTests.test_cursor_explicit_time_zone",
355362
"timezones.tests.NewDatabaseTests.test_raw_sql",
363+
"model_fields.test_jsonfield.TestQuerying.test_key_transform_raw_expression",
364+
"model_fields.test_jsonfield.TestQuerying.test_key_sql_injection_escape",
365+
"model_fields.test_jsonfield.TestQuerying.test_nested_key_transform_raw_expression",
356366
},
357367
"Bilateral transform not implemented.": {
358368
"db_functions.tests.FunctionTests.test_func_transform_bilateral",
@@ -410,7 +420,8 @@ def django_test_expected_failures(self):
410420
},
411421
"Mongodb's Null behaviour is different from sql's": {
412422
"model_fields.test_jsonfield.TestQuerying.test_none_key_and_exact_lookup",
413-
# "model_fields.test_jsonfield.TestQuerying.test_isnull_key",
423+
"model_fields.test_jsonfield.TestSaveLoad.test_json_null_different_from_sql_null",
424+
"model_fields.test_jsonfield.TestQuerying.test_none_key",
414425
},
415426
"Pipeline filtering": {"model_fields.test_jsonfield.TestQuerying.test_icontains"},
416427
}

django_mongodb/fields/auto.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def from_db_value(self, value, expression, connection):
6363

6464

6565
def json_process_rhs(node, compiler, connection):
66+
rhs = node.rhs
67+
if hasattr(rhs, "as_mql"):
68+
return rhs.as_mql(compiler, connection)
6669
_, value = node.process_rhs(compiler, connection)
6770
lookup_name = node.lookup_name
6871
if lookup_name not in ("in", "range"):

0 commit comments

Comments
 (0)