File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -80,12 +80,12 @@ class DatabaseFeatures(BaseDatabaseFeatures):
80
80
"auth_tests.test_views.LoginTest.test_login_session_without_hash_session_key" ,
81
81
# GenericRelation.value_to_string() assumes integer pk.
82
82
"contenttypes_tests.test_fields.GenericRelationTests.test_value_to_string" ,
83
- # contains with subqueries doesn't work.
83
+ # contains with Exists() doesn't work:
84
+ # https://github.com/mongodb-labs/django-mongodb/issues/204
84
85
"model_fields_.test_arrayfield.QueryingTests.test_contains_subquery" ,
86
+ # icontains doesn't work on ArrayField:
85
87
# Unsupported conversion from array to string in $convert
86
88
"model_fields_.test_arrayfield.QueryingTests.test_icontains" ,
87
- # None is $in None
88
- "model_fields_.test_arrayfield.QueryingTests.test_in_as_F_object" ,
89
89
}
90
90
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
91
91
_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