fix: preserve cable paths across export and import

This commit is contained in:
2026-08-24 16:41:57 +02:00
parent 05e33a87a9
commit e44e27d307
8 changed files with 175 additions and 4 deletions
+19
View File
@@ -43,10 +43,29 @@ class PrivateGraphModel(models.Model):
app_label = "graph_tests"
class PortMapping(models.Model):
_netbox_private = True
class Meta:
app_label = "dcim"
class CablePath(models.Model):
_netbox_private = True
class Meta:
app_label = "dcim"
def test_private_plugin_models_are_not_exportable():
assert graph_module.is_exportable_model(PrivateGraphModel) is False
def test_private_port_mappings_are_exported_but_cable_paths_are_not():
assert graph_module.is_exportable_model(PortMapping) is True
assert graph_module.is_exportable_model(CablePath) is False
def test_batched_graph_collects_members_and_dependencies(monkeypatch):
graph_models = (GraphParent, GraphReference, GraphChild, GraphDetail)
with connection.schema_editor() as schema_editor: