diff --git a/tests/models/graph_tests.py b/tests/models/graph_tests.py index ef7968caa9..bcfab45cd0 100644 --- a/tests/models/graph_tests.py +++ b/tests/models/graph_tests.py @@ -2193,14 +2193,14 @@ def test_placing_node_in_separate_card_does_not_pollute_database(self): original_nodegroup_id = node.nodegroup_id updated_nodegroup_id = node.pk - models.NodeGroup.objects.create( + models.NodeGroup.objects.update_or_create( **{ "cardinality": "n", "legacygroupid": "", "nodegroupid": str(updated_nodegroup_id), "parentnodegroup_id": None, } - ).save() + ) node.nodegroup_id = updated_nodegroup_id node.save()