diff --git a/netbox_utilities/__init__.py b/netbox_utilities/__init__.py index 5224147..11f5e83 100644 --- a/netbox_utilities/__init__.py +++ b/netbox_utilities/__init__.py @@ -1,6 +1,6 @@ from netbox.plugins import PluginConfig, get_plugin_config -__version__ = "0.14.3" +__version__ = "0.14.4" class NetBoxUtilitiesConfig(PluginConfig): diff --git a/netbox_utilities/netbox_export.py b/netbox_utilities/netbox_export.py index 975b9db..5d63d63 100644 --- a/netbox_utilities/netbox_export.py +++ b/netbox_utilities/netbox_export.py @@ -18,7 +18,7 @@ from .rack_width import ( logger = logging.getLogger(__name__) -SUPPORTED_NETBOX_EXPORT_VERSIONS = {"0.3.11", "0.3.14"} +SUPPORTED_NETBOX_EXPORT_VERSIONS = {"0.3.11", "0.3.12", "0.3.13", "0.3.14"} RACK_WIDTH_RECORD_KEY = "netbox_utilities_rack_placement" PATCH_MARKER = "_netbox_utilities_rack_width_version" PATCH_VERSION = 1 diff --git a/netbox_utilities/tests/test_connection_scope.py b/netbox_utilities/tests/test_connection_scope.py index a245753..c844e84 100644 --- a/netbox_utilities/tests/test_connection_scope.py +++ b/netbox_utilities/tests/test_connection_scope.py @@ -37,6 +37,9 @@ class _Form(forms.Form): class ConnectionScopeFieldTest(SimpleTestCase): + # Pre-filling the tenant also looks up the tenant group (read-only query). + databases = {"default"} + def test_filter_fields_are_optional_and_chained(self): fields = build_filter_fields() diff --git a/netbox_utilities/tests/test_reorder_rack.py b/netbox_utilities/tests/test_reorder_rack.py index 8ee5f47..8b7a155 100644 --- a/netbox_utilities/tests/test_reorder_rack.py +++ b/netbox_utilities/tests/test_reorder_rack.py @@ -8,6 +8,7 @@ from django.test import RequestFactory, SimpleTestCase from django.urls import resolve, reverse from rest_framework.exceptions import PermissionDenied +import netbox_utilities from netbox_utilities.reorder_rack import ( RackLayoutError, apply_rack_layout, @@ -449,7 +450,7 @@ class ReorderRackFrontendTest(SimpleTestCase): self.assertEqual(template_name, "netbox_utilities/reorder_rack.html") self.assertEqual(context["reorder_devices"][0]["label"], "LEO-Fritzbox") self.assertEqual(context["reorder_devices"][0]["grid_width"], 6) - self.assertEqual(context["asset_version"], "0.10.4") + self.assertEqual(context["asset_version"], netbox_utilities.__version__) self.assertIs(context["reorder_rack_width_data"], get_width_data.return_value) get_width_data.assert_called_once() self.assertIs(get_width_data.call_args.kwargs["rack"], rack) diff --git a/netbox_utilities/tests/test_site_prefix.py b/netbox_utilities/tests/test_site_prefix.py index 892c935..1f136ad 100644 --- a/netbox_utilities/tests/test_site_prefix.py +++ b/netbox_utilities/tests/test_site_prefix.py @@ -72,11 +72,13 @@ class SitePrefixTest(SimpleTestCase): def test_device_and_rack_tables_offer_prefix_column(self): from dcim.tables import DeviceTable, RackTable - self.assertIn(COLUMN_NAME, DeviceTable.base_columns) - self.assertIn(COLUMN_NAME, RackTable.base_columns) + from netbox.registry import registry + + # register_table_column() stores columns in the registry; NetBox adds them when a table is instantiated. for table in (DeviceTable, RackTable): - column = table.base_columns[COLUMN_NAME] - self.assertTrue(column.orderable) + self.assertIn(COLUMN_NAME, registry["tables"][table]) + column = registry["tables"][table][COLUMN_NAME] + self.assertIsNot(column.orderable, False) # None means the table default (sortable) self.assertEqual(tuple(column.order_by), ("site__name",)) self.assertEqual(DeviceTable.Meta.default_columns[:2], ("pk", COLUMN_NAME)) self.assertEqual(RackTable.Meta.default_columns[:2], ("pk", COLUMN_NAME)) diff --git a/netbox_utilities/tests/test_topology_views.py b/netbox_utilities/tests/test_topology_views.py index 9d8b49d..5e4537a 100644 --- a/netbox_utilities/tests/test_topology_views.py +++ b/netbox_utilities/tests/test_topology_views.py @@ -5,6 +5,7 @@ from unittest.mock import MagicMock, patch from django.http import HttpResponse from django.test import RequestFactory, SimpleTestCase +import netbox_utilities from netbox_utilities.topology_views import ( _apply_topology_widths_to_device_tags, _inject_topology_widths, @@ -246,7 +247,7 @@ class TopologyViewsRackWidthTest(SimpleTestCase): self.assertIn('id="netbox-utilities-topology-rack-width-styles"', html) self.assertIn('.rack-device[href="/dcim/devices/334/"]', html) self.assertIn("left: calc(50% + 3px) !important", html) - self.assertIn("netbox_utilities/topology-rack-width.js?v=0.10.4", html) + self.assertIn(f"netbox_utilities/topology-rack-width.js?v={netbox_utilities.__version__}", html) self.assertIn("left:calc(0% + 3px)!important", html) self.assertIn("left:calc(50% + 3px)!important", html) self.assertIn("width:calc(50% - 6px)!important", html) diff --git a/pyproject.toml b/pyproject.toml index 2f9e86b..be57102 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "netbox-utilities" -version = "0.14.3" +version = "0.14.4" description = "Navigation, tenant utilities, connection VLANs, partial-width racks, and bulk operations for NetBox 4.6/4.7" readme = "README.md" requires-python = ">=3.12"