Skip to content

Commit 2291a2a

Browse files
committed
fix two tests
1 parent 05a20b4 commit 2291a2a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.github/workflows/test-python.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: actions/checkout@v4
3434
with:
3535
repository: 'mongodb-forks/django'
36-
ref: 'mongodb-5.1.x'
36+
ref: 'mongodb-5.1.x-convert_truncated_datetime'
3737
path: 'django_repo'
3838
persist-credentials: false
3939
- name: Install system packages for Django's Python test dependencies

django_mongodb_backend/features.py

-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ class DatabaseFeatures(BaseDatabaseFeatures):
6060
"db_functions.math.test_round.RoundTests.test_integer_with_negative_precision",
6161
# Truncating in another timezone doesn't work becauase MongoDB converts
6262
# the result back to UTC.
63-
"datetimes.tests.DateTimesTests.test_21432",
6463
"db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_trunc_func_with_timezone",
6564
"db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_trunc_timezone_applied_before_truncation",
66-
"timezones.tests.NewDatabaseTests.test_query_datetimes",
6765
# Unexpected alias_refcount in alias_map.
6866
"queries.tests.Queries1Tests.test_order_by_tables",
6967
# The $sum aggregation returns 0 instead of None for null.

django_mongodb_backend/operations.py

+3
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ def convert_uuidfield_value(self, value, expression, connection):
159159
value = uuid.UUID(value)
160160
return value
161161

162+
def convert_truncated_datetime(self, value, tzinfo):
163+
return value
164+
162165
def combine_expression(self, connector, sub_expressions):
163166
lhs, rhs = sub_expressions
164167
if connector == Combinable.BITLEFTSHIFT:

0 commit comments

Comments
 (0)