Test factory get_deletable_objects needs to check relationships of children of Tree objects
See original GitHub issueProposed Changes
nautobot.utilities.testing.utils.get_deletable_objects
(in 1.5+) filters a queryset on protected fields fieldname__isnull=True
but also needs to check any children of a tree object. If a child’s fieldname
is not null, you cannot delete the parent.
Justification
Reuse testing code for testing object deletion
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Check for Children Sum Property in a Binary Tree
Given a binary tree, the task is to check for every node, its value is equal to the sum of values of its...
Read more >Everything you need to know about tree data structures
Imagine a family tree with relationships from all generation: grandparents, parents, children, siblings, etc. We commonly organize family trees ...
Read more >Tree-Like Objects - TDD Patterns - XP123
A tree is a natural way to represent a hierarchy. We'll look at various examples, and ways to test-drive trees and their close...
Read more >Trees in Java How to Implement a Binary Tree? - Edureka
A Tree is a non-linear data structure where data objects are generally organized in terms of hierarchical relationship.
Read more >Introduction to data.tree
data.tree structure: a tree, consisting of multiple Node objects. ... linking them together so as to define the parent-child relationships.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@HanlinMiao try this
The above suggestion breaks on
InventoryItem
because the children reverse relationship name ischild_items
instead ofchildren
.