Skip to content
Snippets Groups Projects
Commit 3c8b6e91 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files
parent 0f1c30c3
No related branches found
No related tags found
2 merge requests!149Release 0.15.1,!148F fix datetime value
Pipeline #54240 failed
......@@ -24,6 +24,7 @@ import os
import lxml
import linkahead as db
from datetime import date, datetime
from pytest import raises
......@@ -64,3 +65,26 @@ def test_issue_156():
# </ParentList>
assert value is project
assert parents[0].name == "RTName"
def test_issue_128():
"""Test assigning datetime.date(time) values to DATETIME
properties:
https://gitlab.com/linkahead/linkahead-pylib/-/issues/128.
"""
prop = db.Property(name="TestDatetime", datatype=db.DATETIME)
prop_list = db.Property(name="TestListDatetime", datatype=db.LIST(db.DATETIME))
today = date.today()
now = datetime.now()
prop.value = today
assert prop.value == today
prop.value = now
assert prop.value == now
prop_list.value = [today, today]
assert prop_list.value == [today, today]
prop_list.value = [now, now]
assert prop_list.value == [now, now]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment