Revised the way to import from the datetime package, to avoid name conflict with the common "date" and "time" names.

This commit is contained in:
2023-04-26 13:17:31 +08:00
parent c11ae23885
commit 359c335662
30 changed files with 156 additions and 152 deletions

View File

@@ -17,8 +17,8 @@
"""The test for the options.
"""
import datetime as dt
import unittest
from datetime import datetime, timedelta
import httpx
from flask import Flask
@@ -286,7 +286,8 @@ class OptionTestCase(unittest.TestCase):
with self.app.app_context():
option = db.session.get(Option, "recurring")
self.assertIsNotNone(option)
timestamp: datetime = option.created_at - timedelta(seconds=5)
timestamp: dt.datetime \
= option.created_at - dt.timedelta(seconds=5)
option.created_at = timestamp
option.updated_at = timestamp
db.session.commit()