Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Commit aaa9828

Browse files
author
Micheal Gendy
committed
fix tests issue
1 parent 7baf305 commit aaa9828

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/test_columns.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,34 +165,34 @@ async def test_bulk_update():
165165
await Product.objects.bulk_create(
166166
[
167167
{
168-
"created": "2020-01-01T00:00:00Z",
168+
"created_day": datetime.date.today(),
169169
"data": {"foo": 123},
170170
"value": 123.456,
171171
"status": StatusEnum.RELEASED,
172172
},
173173
{
174-
"created": "2020-01-01T00:00:00Z",
174+
"created_day": datetime.date.today(),
175175
"data": {"foo": 456},
176176
"value": 456.789,
177177
"status": StatusEnum.DRAFT,
178178
},
179179
]
180180
)
181181
products = await Product.objects.all()
182-
products[0].created = "2021-01-01T00:00:00Z"
183-
products[1].created = "2022-01-01T00:00:00Z"
182+
products[0].created_day = datetime.date.today() - datetime.timedelta(days=1)
183+
products[1].created_day = datetime.date.today() - datetime.timedelta(days=1)
184184
products[0].status = StatusEnum.DRAFT
185185
products[1].status = StatusEnum.RELEASED
186186
products[0].data = {"foo": 1234}
187187
products[1].data = {"foo": 5678}
188188
products[0].value = 1234.567
189189
products[1].value = 5678.891
190190
await Product.objects.bulk_update(
191-
products, fields=["created", "status", "data", "value"]
191+
products, fields=["created_day", "status", "data", "value"]
192192
)
193193
products = await Product.objects.all()
194-
assert products[0].created == datetime.datetime(2021, 1, 1, 0, 0, 0)
195-
assert products[1].created == datetime.datetime(2022, 1, 1, 0, 0, 0)
194+
assert products[0].created_day == datetime.date.today() - datetime.timedelta(days=1)
195+
assert products[1].created_day == datetime.date.today() - datetime.timedelta(days=1)
196196
assert products[0].status == StatusEnum.DRAFT
197197
assert products[1].status == StatusEnum.RELEASED
198198
assert products[0].data == {"foo": 1234}

0 commit comments

Comments
 (0)