Skip to content

Commit

Permalink
Update regex in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadkhalaj committed Nov 4, 2023
1 parent 829265b commit 2d6915c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ParameterTestCase:
caption__contains="hello", owner__deleted_at=None
),
expected_query=[
{"$match": {"caption": {"$options": "i", "$regex": ".*hello.*"}}},
{"$match": {"caption": {"$regex": "hello"}}},
{
"$lookup": {
"as": "owner",
Expand All @@ -85,7 +85,7 @@ class ParameterTestCase:
.filter(caption__contains="hello")
.project(caption=1, deleted_at=0),
expected_query=[
{"$match": {"caption": {"$options": "i", "$regex": ".*hello.*"}}},
{"$match": {"caption": {"$regex": "hello"}}},
{"$project": {"caption": 1, "deleted_at": 0}},
],
),
Expand All @@ -102,11 +102,10 @@ class ParameterTestCase:
"$or": [
{
"caption": {
"$options": "i",
"$regex": ".*['hello'].*",
"$regex": "['hello']",
}
},
{"location": {"$options": "i", "$regex": ".*test.*"}},
{"location": {"$regex": "test"}},
]
},
{"deleted_at": None},
Expand Down

0 comments on commit 2d6915c

Please sign in to comment.