Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardens editable_future_graph against nodegroup changes #11570 #11609

Open
wants to merge 25 commits into
base: dev/8.0.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nit #11570
chrabyrd committed Nov 14, 2024
commit 723485d3c9ace93d26e53988bf1890cadf2535a8
16 changes: 10 additions & 6 deletions tests/models/graph_tests.py
Original file line number Diff line number Diff line change
@@ -2186,21 +2186,25 @@ def test_placing_node_in_separate_card_does_not_pollute_database(self):
)
editable_future_graph = updated_source_graph.create_editable_future_graph()

node = [node for node in editable_future_graph.nodes.values()][2]

# fixes flaky test
models.NodeGroup.objects.filter(pk=node.pk).delete()

nodegroup_count_before = models.NodeGroup.objects.count()

node = [node for node in editable_future_graph.nodes.values()][2]
source_identifier_id = node.source_identifier_id
original_nodegroup_id = node.nodegroup_id
updated_nodegroup_id = node.pk

models.NodeGroup.objects.update_or_create(
nodegroupid=str(updated_nodegroup_id),
defaults={
models.NodeGroup.objects.create(
**{
"cardinality": "n",
"legacygroupid": "",
"nodegroupid": str(updated_nodegroup_id),
"parentnodegroup_id": None,
},
)
}
).save()

node.nodegroup_id = updated_nodegroup_id
node.save()