From 6bba8eb909ba2c570bf7fa659b025a92bdcf11bf Mon Sep 17 00:00:00 2001
From: inso <insomniak.fr@gmaiL.com>
Date: Wed, 4 May 2016 06:17:22 +0200
Subject: [PATCH] Fix tests

---
 src/sakia/tests/unit/gui/views/test_explorer_scene.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sakia/tests/unit/gui/views/test_explorer_scene.py b/src/sakia/tests/unit/gui/views/test_explorer_scene.py
index 9585e42c..7ba89017 100644
--- a/src/sakia/tests/unit/gui/views/test_explorer_scene.py
+++ b/src/sakia/tests/unit/gui/views/test_explorer_scene.py
@@ -22,7 +22,7 @@ class TestExplorerScene(unittest.TestCase, QuamashTest):
         #    -> E
         self.identity_status = [NodeStatus.SELECTED, NodeStatus.NEUTRAL, NodeStatus.NEUTRAL,
                                 NodeStatus.OUT, NodeStatus.NEUTRAL]
-        self.test_graph = networkx.MultiDiGraph().to_undirected()
+        self.test_graph = networkx.MultiDiGraph()
         self.test_graph.add_nodes_from(self.identities_pubkeys)
         self.test_graph.add_edges_from(self.certifications)
         for index, node in enumerate(self.test_graph.nodes(data=True)):
@@ -119,7 +119,9 @@ class TestExplorerScene(unittest.TestCase, QuamashTest):
     @patch('networkx.MultiDiGraph')
     def test_set_subtree_position(self, mock_graph):
         # We mock the edges generator to ensure the order in which they appear
-        mock_graph.edges = Mock(return_value=self.certifications)
+        undirected = Mock('networkx.MultiDiGraph')
+        undirected.edges = Mock(return_value=self.certifications)
+        mock_graph.to_undirected = Mock(return_value=undirected)
         data_layout = {}
 
         for pubkey in self.identities_pubkeys:
-- 
GitLab