Skip to content

Commit bed337e

Browse files
committed
Fix test for Date and DateNano #6
1 parent 131f086 commit bed337e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_box.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from tests.model import TestEntity
55
from tests.common import autocleanup, load_empty_test_objectbox, assert_equal
66
import time
7+
from math import floor
78

89

910
def test_box_basics():
@@ -57,8 +58,8 @@ def test_box_basics():
5758

5859
# update
5960
object.str = "bar"
60-
object.date = time.time_ns() / 1000000 # check that date can also be int
61-
object.date_nano = time.time() * 1000000000 # check that date_nano can also be float
61+
object.date = floor(time.time_ns() / 1000000) # check that date can also be int
62+
object.date_nano = float(time.time() * 1000000000) # check that date_nano can also be float
6263
id = box.put(object)
6364
assert id == 5
6465

0 commit comments

Comments
 (0)