1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Clean up tests

This commit is contained in:
jeremystretch
2022-05-23 14:50:58 -04:00
parent 4ec26aa6aa
commit 50c872c47c
4 changed files with 12 additions and 30 deletions

View File

@@ -521,14 +521,6 @@ class CableTestCase(TestCase):
self.assertIsNone(interface2.cable)
self.assertIsNone(interface2._link_peer)
def test_cabletermination_deletion(self):
"""
When a CableTermination object is deleted, its attached Cable (if any) must also be deleted.
"""
self.interface1.delete()
cable = Cable.objects.filter(pk=self.cable.pk).first()
self.assertIsNone(cable)
def test_cable_validates_compatible_types(self):
"""
The clean method should have a check to ensure only compatible port types can be connected by a cable
@@ -538,14 +530,6 @@ class CableTestCase(TestCase):
with self.assertRaises(ValidationError):
cable.clean()
def test_cable_cannot_have_the_same_terminination_on_both_ends(self):
"""
A cable cannot be made with the same A and B side terminations
"""
cable = Cable(a_terminations=[self.interface1], b_terminations=[self.interface1])
with self.assertRaises(ValidationError):
cable.clean()
def test_cable_front_port_cannot_connect_to_corresponding_rear_port(self):
"""
A cable cannot connect a front port to its corresponding rear port
@@ -554,15 +538,6 @@ class CableTestCase(TestCase):
with self.assertRaises(ValidationError):
cable.clean()
def test_cable_cannot_terminate_to_an_existing_connection(self):
"""
Either side of a cable cannot be terminated when that side already has a connection
"""
# Try to create a cable with the same interface terminations
cable = Cable(a_terminations=[self.interface2], b_terminations=[self.interface1])
with self.assertRaises(ValidationError):
cable.clean()
def test_cable_cannot_terminate_to_a_provider_network_circuittermination(self):
"""
Neither side of a cable can be terminated to a CircuitTermination which is attached to a ProviderNetwork