mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Update tests for nested TenantGroups
This commit is contained in:
@@ -8,11 +8,13 @@ class TenantGroupTestCase(ViewTestCases.OrganizationalObjectViewTestCase):
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
|
||||
TenantGroup.objects.bulk_create([
|
||||
tenant_groups = (
|
||||
TenantGroup(name='Tenant Group 1', slug='tenant-group-1'),
|
||||
TenantGroup(name='Tenant Group 2', slug='tenant-group-2'),
|
||||
TenantGroup(name='Tenant Group 3', slug='tenant-group-3'),
|
||||
])
|
||||
)
|
||||
for tenanantgroup in tenant_groups:
|
||||
tenanantgroup.save()
|
||||
|
||||
cls.form_data = {
|
||||
'name': 'Tenant Group X',
|
||||
@@ -33,22 +35,23 @@ class TenantTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
|
||||
tenantgroups = (
|
||||
tenant_groups = (
|
||||
TenantGroup(name='Tenant Group 1', slug='tenant-group-1'),
|
||||
TenantGroup(name='Tenant Group 2', slug='tenant-group-2'),
|
||||
)
|
||||
TenantGroup.objects.bulk_create(tenantgroups)
|
||||
for tenanantgroup in tenant_groups:
|
||||
tenanantgroup.save()
|
||||
|
||||
Tenant.objects.bulk_create([
|
||||
Tenant(name='Tenant 1', slug='tenant-1', group=tenantgroups[0]),
|
||||
Tenant(name='Tenant 2', slug='tenant-2', group=tenantgroups[0]),
|
||||
Tenant(name='Tenant 3', slug='tenant-3', group=tenantgroups[0]),
|
||||
Tenant(name='Tenant 1', slug='tenant-1', group=tenant_groups[0]),
|
||||
Tenant(name='Tenant 2', slug='tenant-2', group=tenant_groups[0]),
|
||||
Tenant(name='Tenant 3', slug='tenant-3', group=tenant_groups[0]),
|
||||
])
|
||||
|
||||
cls.form_data = {
|
||||
'name': 'Tenant X',
|
||||
'slug': 'tenant-x',
|
||||
'group': tenantgroups[1].pk,
|
||||
'group': tenant_groups[1].pk,
|
||||
'description': 'A new tenant',
|
||||
'comments': 'Some comments',
|
||||
'tags': 'Alpha,Bravo,Charlie',
|
||||
@@ -62,5 +65,5 @@ class TenantTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
||||
)
|
||||
|
||||
cls.bulk_edit_data = {
|
||||
'group': tenantgroups[1].pk,
|
||||
'group': tenant_groups[1].pk,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user