File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -82,16 +82,12 @@ class DatabaseFeatures(BaseDatabaseFeatures):
82
82
"auth_tests.test_views.LoginTest.test_login_session_without_hash_session_key" ,
83
83
# GenericRelation.value_to_string() assumes integer pk.
84
84
"contenttypes_tests.test_fields.GenericRelationTests.test_value_to_string" ,
85
- # contains with subqueries doesn't work.
85
+ # contains with Exists() doesn't work:
86
+ # https://github.com/mongodb-labs/django-mongodb/issues/204
86
87
"model_fields_.test_arrayfield.QueryingTests.test_contains_subquery" ,
88
+ # icontains doesn't work on ArrayField:
87
89
# Unsupported conversion from array to string in $convert
88
90
"model_fields_.test_arrayfield.QueryingTests.test_icontains" ,
89
- # $lt treats null values as zero.
90
- "model_fields_.test_arrayfield.QueryingTests.test_lt" ,
91
- "model_fields_.test_arrayfield.QueryingTests.test_len" ,
92
- "model_fields_.test_arrayfield.QueryingTests.test_index_chained" ,
93
- # None is $in None
94
- "model_fields_.test_arrayfield.QueryingTests.test_in_as_F_object" ,
95
91
}
96
92
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
97
93
_django_test_expected_failures_bitwise = {
Original file line number Diff line number Diff line change @@ -289,10 +289,8 @@ def test_in_subquery(self):
289
289
290
290
@unittest .expectedFailure
291
291
def test_in_including_F_object (self ):
292
- # This test asserts that Array objects passed to filters can be
293
- # constructed to contain F objects. This currently doesn't work as the
294
- # psycopg mogrify method that generates the ARRAY() syntax is
295
- # expecting literals, not column references (#27095).
292
+ # Array objects passed to filters can be constructed to contain
293
+ # F objects. This doesn't work on PostgreSQL either (#27095).
296
294
self .assertSequenceEqual (
297
295
NullableIntegerArrayModel .objects .filter (field__in = [[models .F ("id" )]]),
298
296
self .objs [:2 ],
@@ -301,7 +299,12 @@ def test_in_including_F_object(self):
301
299
def test_in_as_F_object (self ):
302
300
self .assertSequenceEqual (
303
301
NullableIntegerArrayModel .objects .filter (field__in = [models .F ("field" )]),
304
- self .objs [:4 ],
302
+ # Unlike PostgreSQL, MongoDB returns documents with field=null,
303
+ # i.e. null is in [null]. It seems okay to leave this alone rather
304
+ # than filtering out null in all $in queries. Feel free to
305
+ # reconsider this decision if the behavior is problematic in some
306
+ # other query.
307
+ self .objs ,
305
308
)
306
309
307
310
def test_contains (self ):
You can’t perform that action at this time.
0 commit comments