File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 6
6
from selenium import webdriver
7
7
8
8
from neo4j_viz import Node , Relationship , VisualizationGraph
9
+ from neo4j_viz .nvl import NVL
9
10
from neo4j_viz .options import Layout , Renderer
10
11
11
12
render_cases = {
@@ -98,15 +99,15 @@ def test_render_warnings() -> None:
98
99
def test_render_non_json_serializable () -> None :
99
100
import datetime
100
101
101
- nodes = [
102
- Node (
103
- id = 0 ,
104
- properties = {
105
- "non-json-serializable" : datetime . datetime . now () ,
106
- },
107
- )
108
- ]
109
-
110
- VG = VisualizationGraph (nodes = nodes , relationships = [])
111
-
102
+ now = datetime . datetime . now ()
103
+ node = Node (
104
+ id = 0 ,
105
+ properties = {
106
+ "non-json-serializable" : now ,
107
+ },
108
+ )
109
+ assert str ( now ) in NVL . _serialize_entity ( node )
110
+
111
+ VG = VisualizationGraph (nodes = [ node ] , relationships = [])
112
+ # Should not raise an error
112
113
VG .render ()
You can’t perform that action at this time.
0 commit comments