Explicitly convert date and datetime to QDate and QDateTime (#2325)

This commit is contained in:
Veronica Berglyd Olsen
2025-05-04 17:03:39 +02:00
parent da84d40cd5
commit d6fcc89da3
2 changed files with 16 additions and 4 deletions
+7
View File
@@ -20,6 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from __future__ import annotations
import datetime
import json
import sys
@@ -189,6 +190,12 @@ def testBaseConfig_Localisation(fncPath, tstPaths):
languages = tstConf.listLanguages(tstConf.LANG_NW)
assert languages == [("en_GB", "British English"), ("fr", "Français")]
# Date Formats
# Checks for bug #2325
assert CONFIG._dLocale.bcp47Name() == "en-GB"
assert CONFIG.localDate(datetime.datetime.fromtimestamp(1746370775)) == "04/05/2025"
assert CONFIG.localDateTime(datetime.datetime.fromtimestamp(1746370775)) == "04/05/2025 16:59"
@pytest.mark.base
def testBaseConfig_Methods(fncPath):