17058 fix tests

This commit is contained in:
Arthur Hanson 2024-08-01 15:39:29 +07:00
parent 6b9d1ddb93
commit d18b739ac3
4 changed files with 4 additions and 5 deletions

View File

@ -319,7 +319,7 @@ class RackTypeFilterSet(NetBoxModelFilterSet):
if not value.strip(): if not value.strip():
return queryset return queryset
return queryset.filter( return queryset.filter(
Q(name__icontains=value) | Q(model__icontains=value) |
Q(description__icontains=value) | Q(description__icontains=value) |
Q(comments__icontains=value) Q(comments__icontains=value)
) )

View File

@ -613,7 +613,6 @@ class PowerPortTemplateType(ModularComponentTemplateType):
filters=RackTypeFilter filters=RackTypeFilter
) )
class RackTypeType(NetBoxObjectType): class RackTypeType(NetBoxObjectType):
_name: str
manufacturer: Annotated["ManufacturerType", strawberry.lazy('dcim.graphql.types')] manufacturer: Annotated["ManufacturerType", strawberry.lazy('dcim.graphql.types')]

View File

@ -663,7 +663,7 @@ class RackTestCase(TestCase, ChangeLoggedFilterSetTests):
rack_types = ( rack_types = (
RackType( RackType(
manufacturer=manufacturers[0], manufacturer=manufacturers[0],
name='RackType 1', model='RackType 1',
slug='rack-type-1', slug='rack-type-1',
form_factor=RackFormFactorChoices.TYPE_2POST, form_factor=RackFormFactorChoices.TYPE_2POST,
width=RackWidthChoices.WIDTH_19IN, width=RackWidthChoices.WIDTH_19IN,
@ -681,7 +681,7 @@ class RackTestCase(TestCase, ChangeLoggedFilterSetTests):
), ),
RackType( RackType(
manufacturer=manufacturers[1], manufacturer=manufacturers[1],
name='RackType 2', model='RackType 2',
slug='rack-type-2', slug='rack-type-2',
form_factor=RackFormFactorChoices.TYPE_4POST, form_factor=RackFormFactorChoices.TYPE_4POST,
width=RackWidthChoices.WIDTH_21IN, width=RackWidthChoices.WIDTH_21IN,

View File

@ -82,7 +82,7 @@ class RackTypeTestCase(TestCase):
RackType.objects.create( RackType.objects.create(
manufacturer=manufacturer, manufacturer=manufacturer,
name='RackType 1', model='RackType 1',
slug='rack-type-1', slug='rack-type-1',
width=11, width=11,
u_height=22, u_height=22,