Skip to content

Commit 1862cf8

Browse files
Merge pull request #13 from Nix3c3r/fix/pytest
Fix hard coded pks
2 parents 20c4797 + bdd02ed commit 1862cf8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ def test_02_dag(self):
251251
)
252252
log.debug("Check attributes")
253253
self.assertEqual(nx_out.graph, {"test": "test"})
254-
self.assertEqual(nx_out.nodes[11], {"id": 11, "name": "root"})
255-
self.assertEqual(nx_out.edges[11, 14], {"id": 4, "name": "root a3"})
254+
self.assertEqual(nx_out.nodes[root.pk], {"id": root.pk, "name": "root"})
255+
self.assertEqual(
256+
nx_out.edges[root.pk, a3.pk], {"id": NetworkEdge.objects.get(parent=root, child=a3).pk, "name": "root a3"}
257+
)
256258

257259
"""
258260
Simulate a basic irrigation canal network

0 commit comments

Comments
 (0)