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

Enable bulk creation tests for device components

This commit is contained in:
Jeremy Stretch
2020-02-05 15:22:57 -05:00
parent 75906f7591
commit 0ad613e6b4
5 changed files with 194 additions and 8 deletions

View File

@@ -198,10 +198,11 @@ class InterfaceTestCase(StandardTestCases.Views):
# Disable inapplicable tests
test_list_objects = None
test_create_object = None
test_import_objects = None
# TODO
test_create_object = None
def test_bulk_create_objects(self):
return self._test_bulk_create_objects(expected_count=3)
def _get_base_url(self):
# Interface belongs to the DCIM app, so we have to override the base URL
@@ -262,6 +263,21 @@ class InterfaceTestCase(StandardTestCases.Views):
"Device 1,Interface 6,1000BASE-T (1GE)",
)
cls.bulk_create_data = {
'virtual_machine': virtualmachines[1].pk,
'name_pattern': 'Interface [4-6]',
'type': InterfaceTypeChoices.TYPE_VIRTUAL,
'enabled': False,
'mgmt_only': False,
'mac_address': EUI('01-02-03-04-05-06'),
'mtu': 2000,
'description': 'New description',
'mode': InterfaceModeChoices.MODE_TAGGED,
'untagged_vlan': vlans[0].pk,
'tagged_vlans': [v.pk for v in vlans[1:4]],
'tags': 'Alpha,Bravo,Charlie',
}
cls.bulk_edit_data = {
'virtual_machine': virtualmachines[1].pk,
'enabled': False,