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

More work on #1523 (natural ordering for interfaces)

This commit is contained in:
Jeremy Stretch
2017-09-22 16:18:43 -04:00
parent d7b0ba57e0
commit a010f7439d
2 changed files with 29 additions and 21 deletions

View File

@ -159,10 +159,14 @@ class InterfaceTestCase(TestCase):
device=device1,
name='Ethernet1/3/2/1'
)
interface6 = Interface.objects.create(
device=device1,
name='Loopback1'
)
self.assertEqual(
list(Interface.objects.all().order_naturally()),
[interface1, interface5, interface4, interface3, interface2]
[interface1, interface5, interface4, interface3, interface2, interface6]
)
def test_interface_order_natural_subinterfaces(self):
@ -201,5 +205,5 @@ class InterfaceTestCase(TestCase):
)
self.assertEqual(
list(Interface.objects.all().order_naturally()),
[interface6, interface4, interface3, interface5, interface2, interface1]
[interface4, interface3, interface5, interface2, interface1, interface6]
)