Skip to content

Commit

Permalink
add test for #1175
Browse files Browse the repository at this point in the history
  • Loading branch information
bagerard committed Sep 28, 2024
1 parent 94b5b69 commit 9aab9d2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/queryset/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@

from mongoengine import *
from mongoengine.queryset import Q, transform
from tests.utils import MongoDBTestCase


class TestTransform(unittest.TestCase):
def setUp(self):
connect(db="mongoenginetest")
class TestTransform(MongoDBTestCase):

def test_transform_str_datetime(self):
data = {"date": {"$ne": "2015-12-01T00:00:00"}}
assert transform.query(**data) == {"date": {"$ne": "2015-12-01T00:00:00"}}
assert transform.query(date__ne="2015-12-01T00:00:00") == {
"date": {"$ne": "2015-12-01T00:00:00"}
}

def test_transform_query(self):
"""Ensure that the _transform_query function operates correctly."""
Expand Down

0 comments on commit 9aab9d2

Please sign in to comment.