Closes #19521: Clean up test suite output (#19524)

This commit is contained in:
Jeremy Stretch
2025-05-21 12:57:32 -04:00
committed by GitHub
parent 88565e8f68
commit 51d046b1f5
8 changed files with 40 additions and 15 deletions

View File

@@ -1,3 +1,5 @@
import logging
from django.test import tag
from django.urls import reverse
from netaddr import IPNetwork
@@ -10,7 +12,9 @@ from extras.choices import CustomFieldTypeChoices
from extras.models import ConfigTemplate, CustomField
from ipam.choices import VLANQinQRoleChoices
from ipam.models import Prefix, VLAN, VRF
from utilities.testing import APITestCase, APIViewTestCases, create_test_device, create_test_virtualmachine
from utilities.testing import (
APITestCase, APIViewTestCases, create_test_device, create_test_virtualmachine, disable_logging,
)
from virtualization.choices import *
from virtualization.models import *
@@ -402,7 +406,8 @@ class VMInterfaceTest(APIViewTestCases.APIViewTestCase):
# Attempt to delete only the parent interface
url = self._get_detail_url(interface1)
self.client.delete(url, **self.header)
with disable_logging(level=logging.WARNING):
self.client.delete(url, **self.header)
self.assertEqual(virtual_machine.interfaces.count(), 4) # Parent was not deleted
# Attempt to bulk delete parent & child together