mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 00:15:17 -06:00
Misc cleanup
This commit is contained in:
parent
bdb5175316
commit
cce89a55fb
@ -1086,7 +1086,11 @@ class CustomFieldImportTest(TestCase):
|
||||
)
|
||||
csv_data = '\n'.join(','.join(row) for row in data)
|
||||
|
||||
response = self.client.post(reverse('dcim:site_import'), {'data': csv_data, 'format': ImportFormatChoices.CSV, 'csv_delimiter': CSVDelimiterChoices.AUTO})
|
||||
response = self.client.post(reverse('dcim:site_import'), {
|
||||
'data': csv_data,
|
||||
'format': ImportFormatChoices.CSV,
|
||||
'csv_delimiter': CSVDelimiterChoices.AUTO,
|
||||
})
|
||||
self.assertEqual(response.status_code, 302)
|
||||
self.assertEqual(Site.objects.count(), 3)
|
||||
|
||||
|
@ -239,8 +239,8 @@ class CSVDelimiterChoices(ChoiceSet):
|
||||
TAB = '\t'
|
||||
|
||||
CHOICES = [
|
||||
(AUTO, 'Auto-detect'),
|
||||
(COMMA, 'Comma'),
|
||||
(SEMICOLON, 'Semicolon'),
|
||||
(TAB, 'Tab'),
|
||||
(AUTO, _('Auto-detect')),
|
||||
(COMMA, _('Comma')),
|
||||
(SEMICOLON, _('Semicolon')),
|
||||
(TAB, _('Tab')),
|
||||
]
|
||||
|
@ -24,7 +24,7 @@ class BulkImportForm(BootstrapMixin, SyncedDataMixin, forms.Form):
|
||||
help_text=_("Enter object data in CSV, JSON or YAML format.")
|
||||
)
|
||||
upload_file = forms.FileField(
|
||||
label="Data file",
|
||||
label=_("Data file"),
|
||||
required=False
|
||||
)
|
||||
format = forms.ChoiceField(
|
||||
@ -34,7 +34,7 @@ class BulkImportForm(BootstrapMixin, SyncedDataMixin, forms.Form):
|
||||
csv_delimiter = forms.ChoiceField(
|
||||
choices=CSVDelimiterChoices,
|
||||
initial=CSVDelimiterChoices.AUTO,
|
||||
label="CSV Delimiter",
|
||||
label=_("CSV delimiter"),
|
||||
help_text=_("The character which delimits CSV fields. Applies only to CSV format."),
|
||||
required=False
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user