12826 fix tests

This commit is contained in:
Arthur Hanson 2024-06-25 13:06:31 -07:00
parent b6a785d24a
commit 25a55c56c8
2 changed files with 12 additions and 12 deletions

View File

@ -282,7 +282,7 @@ class RackTypeBulkEditForm(NetBoxModelBulkEditForm):
) )
comments = CommentField() comments = CommentField()
model = Rack model = RackType
fieldsets = ( fieldsets = (
FieldSet('description', name=_('Rack')), FieldSet('description', name=_('Rack')),
FieldSet( FieldSet(
@ -292,7 +292,7 @@ class RackTypeBulkEditForm(NetBoxModelBulkEditForm):
FieldSet('weight', 'max_weight', 'weight_unit', name=_('Weight')), FieldSet('weight', 'max_weight', 'weight_unit', name=_('Weight')),
) )
nullable_fields = ( nullable_fields = (
'role', 'outer_width', 'outer_depth', 'outer_unit', 'weight', 'outer_width', 'outer_depth', 'outer_unit', 'weight',
'max_weight', 'weight_unit', 'description', 'comments', 'max_weight', 'weight_unit', 'description', 'comments',
) )

View File

@ -343,16 +343,16 @@ class RackTypeTestCase(ViewTestCases.PrimaryObjectViewTestCase):
def setUpTestData(cls): def setUpTestData(cls):
racks = ( racks = (
Rack(name='Rack 1'), Rack(name='RackType 1'),
Rack(name='Rack 2'), Rack(name='RackType 2'),
Rack(name='Rack 3'), Rack(name='RackType 3'),
) )
RackType.objects.bulk_create(racks) RackType.objects.bulk_create(racks)
tags = create_tags('Alpha', 'Bravo', 'Charlie') tags = create_tags('Alpha', 'Bravo', 'Charlie')
cls.form_data = { cls.form_data = {
'name': 'Rack X', 'name': 'RackType X',
'type': RackTypeChoices.TYPE_CABINET, 'type': RackTypeChoices.TYPE_CABINET,
'width': RackWidthChoices.WIDTH_19IN, 'width': RackWidthChoices.WIDTH_19IN,
'u_height': 48, 'u_height': 48,
@ -370,16 +370,16 @@ class RackTypeTestCase(ViewTestCases.PrimaryObjectViewTestCase):
cls.csv_data = ( cls.csv_data = (
"name,width,u_height,weight,max_weight,weight_unit", "name,width,u_height,weight,max_weight,weight_unit",
"Rack 4,19,42,100,2000,kg", "RackType 4,19,42,100,2000,kg",
"Rack 5,19,42,100,2000,kg", "RackType 5,19,42,100,2000,kg",
"Rack 6,19,42,100,2000,kg", "RackType 6,19,42,100,2000,kg",
) )
cls.csv_update_data = ( cls.csv_update_data = (
"id,name", "id,name",
f"{racks[0].pk},Rack 7", f"{racks[0].pk},RackType 7",
f"{racks[1].pk},Rack 8", f"{racks[1].pk},RackType 8",
f"{racks[2].pk},Rack 9", f"{racks[2].pk},RackType 9",
) )
cls.bulk_edit_data = { cls.bulk_edit_data = {