mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-14 07:42:18 -06:00
* Fixes #17443: Adds ExportTemplate.file_name field * Addresses PR feedback - Adds `file_name` to `ExportTemplateBulkEditForm.nullable_fields` - Shortens max length of `ExportTemplate.file_name` to 200 chars - Adds tests for `ExportTemplateFilterSet.file_extension` * Fixes migration conflict caused by fix for #17841
This commit is contained in:
@@ -479,6 +479,7 @@ class ExportTemplateTest(APIViewTestCases.APIViewTestCase):
|
||||
'object_types': ['dcim.device'],
|
||||
'name': 'Test Export Template 6',
|
||||
'template_code': '{% for obj in queryset %}{{ obj.name }}\n{% endfor %}',
|
||||
'file_name': 'test_export_template_6',
|
||||
},
|
||||
]
|
||||
bulk_update_data = {
|
||||
@@ -494,7 +495,9 @@ class ExportTemplateTest(APIViewTestCases.APIViewTestCase):
|
||||
),
|
||||
ExportTemplate(
|
||||
name='Export Template 2',
|
||||
template_code='{% for obj in queryset %}{{ obj.name }}\n{% endfor %}'
|
||||
template_code='{% for obj in queryset %}{{ obj.name }}\n{% endfor %}',
|
||||
file_name='export_template_2',
|
||||
file_extension='test',
|
||||
),
|
||||
ExportTemplate(
|
||||
name='Export Template 3',
|
||||
@@ -502,8 +505,10 @@ class ExportTemplateTest(APIViewTestCases.APIViewTestCase):
|
||||
),
|
||||
)
|
||||
ExportTemplate.objects.bulk_create(export_templates)
|
||||
|
||||
device_object_type = ObjectType.objects.get_for_model(Device)
|
||||
for et in export_templates:
|
||||
et.object_types.set([ObjectType.objects.get_for_model(Device)])
|
||||
et.object_types.set([device_object_type])
|
||||
|
||||
|
||||
class TagTest(APIViewTestCases.APIViewTestCase):
|
||||
|
||||
Reference in New Issue
Block a user