# Conflicts:
#	README.md
#	netbox_slm/__init__.py
This commit is contained in:
MrBlake committed 2026-10-21 14:06:20 +02:00
commit 8e18ae82b8
6 files changed
+166 -184

No files matched your search

@@ -0,0 +1,18 @@
# Generated by Django 6.1.1 on 2026-10-13 12:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('netbox_slm', '0014_softwarelicense_email_notification_permission'),
]
operations = [
migrations.AlterConstraint(
model_name='softwareproductinstallation',
name='netbox_slm_softwareproductinstallation_platform',
constraint=models.CheckConstraint(condition=models.Q(models.Q(('cluster__isnull', True), ('device__isnull', False), ('virtualmachine__isnull', True)), models.Q(('cluster__isnull', True), ('device__isnull', True), ('virtualmachine__isnull', False)), models.Q(('cluster__isnull', False), ('device__isnull', True), ('virtualmachine__isnull', True)), _connector='OR'), name='netbox_slm_softwareproductinstallation_platform', violation_error_message='Select exactly one platform destination: device, virtual machine, or cluster.'),
),
]
@@ -15,7 +15,7 @@ class Migration(migrations.Migration):
("extras", "0001_initial"),
("tenancy", "0001_initial"),
("virtualization", "0001_initial"),
("netbox_slm", "0014_softwarelicense_email_notification_permission"),
("netbox_slm", "0015_platform_constraint_message"),
]
operations = [
+2 -20
View File
@@ -17,8 +17,8 @@ class SlmBaseTestCase(TestCase):
software_product_installation: SoftwareProductInstallation
@classmethod
def setUpClass(cls):
super().setUpClass()
def setUpTestData(cls):
# setUpTestData rolls back after the class and gives every test its own copy of these objects.
manufacturer = Manufacturer.objects.create(name="test manufacturer")
device_type = DeviceType.objects.create(model="test device type", manufacturer=manufacturer)
device_role = DeviceRole.objects.create(name="test device role")
@@ -46,21 +46,3 @@ class SlmBaseTestCase(TestCase):
tenant_group=cls.tenant_group,
tenant=cls.tenant,
)
@classmethod
def tearDownClass(cls):
SoftwareLicense.objects.all().delete()
SoftwareProductInstallation.objects.all().delete()
SoftwareProductVersion.objects.all().delete()
SoftwareProduct.objects.all().delete()
Tenant.objects.all().delete()
TenantGroup.objects.all().delete()
Cluster.objects.all().delete()
ClusterType.objects.all().delete()
VirtualMachine.objects.all().delete()
Device.objects.all().delete()
Site.objects.all().delete()
DeviceRole.objects.all().delete()
DeviceType.objects.all().delete()
Manufacturer.objects.all().delete()
super().tearDownClass()
-5
View File
@@ -12,11 +12,6 @@ class FunctionalTestCase(SlmBaseTestCase):
test_user, _ = get_user_model().objects.get_or_create(username="test", is_superuser=True)
self.client.force_login(test_user)
@classmethod
def tearDownClass(cls):
get_user_model().objects.all().delete()
super().tearDownClass()
def test_template_content(self):
cluster_response = self.client.get(f"/virtualization/clusters/{self.cluster.pk}/")
self.assertContains(cluster_response, f'<a href="/plugins/slm/installations/add/?cluster={self.cluster.pk}"')