mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-09 00:58:16 -06:00
15106 add tests
This commit is contained in:
parent
75e6b4467e
commit
1165fe4560
@ -113,6 +113,8 @@ class WirelessLinkTest(APIViewTestCases.APIViewTestCase):
|
||||
brief_fields = ['description', 'display', 'id', 'ssid', 'url']
|
||||
bulk_update_data = {
|
||||
'status': 'planned',
|
||||
'length': 100,
|
||||
'length_unit': 'm',
|
||||
}
|
||||
|
||||
@classmethod
|
||||
|
@ -260,6 +260,8 @@ class WirelessLinkTestCase(TestCase, ChangeLoggedFilterSetTests):
|
||||
auth_cipher=WirelessAuthCipherChoices.CIPHER_AUTO,
|
||||
auth_psk='PSK1',
|
||||
tenant=tenants[0],
|
||||
length=10,
|
||||
length_unit=WirelessLinkLengthUnitChoices.UNIT_FOOT,
|
||||
description='foobar1'
|
||||
).save()
|
||||
WirelessLink(
|
||||
@ -271,6 +273,8 @@ class WirelessLinkTestCase(TestCase, ChangeLoggedFilterSetTests):
|
||||
auth_cipher=WirelessAuthCipherChoices.CIPHER_TKIP,
|
||||
auth_psk='PSK2',
|
||||
tenant=tenants[1],
|
||||
length=20,
|
||||
length_unit=WirelessLinkLengthUnitChoices.UNIT_METER,
|
||||
description='foobar2'
|
||||
).save()
|
||||
WirelessLink(
|
||||
@ -281,6 +285,8 @@ class WirelessLinkTestCase(TestCase, ChangeLoggedFilterSetTests):
|
||||
auth_type=WirelessAuthTypeChoices.TYPE_WPA_PERSONAL,
|
||||
auth_cipher=WirelessAuthCipherChoices.CIPHER_AES,
|
||||
auth_psk='PSK3',
|
||||
length=30,
|
||||
length_unit=WirelessLinkLengthUnitChoices.UNIT_METER,
|
||||
tenant=tenants[2],
|
||||
).save()
|
||||
WirelessLink(
|
||||
@ -313,6 +319,14 @@ class WirelessLinkTestCase(TestCase, ChangeLoggedFilterSetTests):
|
||||
params = {'auth_psk': ['PSK1', 'PSK2']}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)
|
||||
|
||||
def test_length(self):
|
||||
params = {'length': [10, 20]}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)
|
||||
|
||||
def test_length_unit(self):
|
||||
params = {'length_unit': WirelessLinkLengthUnitChoices.UNIT_FOOT}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1)
|
||||
|
||||
def test_description(self):
|
||||
params = {'description': ['foobar1', 'foobar2']}
|
||||
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)
|
||||
|
@ -160,6 +160,8 @@ class WirelessLinkTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
||||
'interface_a': interfaces[6].pk,
|
||||
'interface_b': interfaces[7].pk,
|
||||
'status': LinkStatusChoices.STATUS_PLANNED,
|
||||
'length': 100,
|
||||
'length_unit': WirelessLinkLengthUnitChoices.UNIT_FOOT,
|
||||
'tenant': tenants[1].pk,
|
||||
'tags': [t.pk for t in tags],
|
||||
}
|
||||
@ -180,4 +182,6 @@ class WirelessLinkTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
||||
|
||||
cls.bulk_edit_data = {
|
||||
'status': LinkStatusChoices.STATUS_PLANNED,
|
||||
'length': 50,
|
||||
'length_unit': WirelessLinkLengthUnitChoices.UNIT_METER,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user