mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-23 16:06:43 -06:00
Add test for bug #13791
https://github.com/netbox-community/netbox/issues/13791
This commit is contained in:
parent
2dfbd72f10
commit
320efa7934
@ -3,6 +3,7 @@ from django.test import TestCase
|
||||
|
||||
from utilities.choices import ImportFormatChoices
|
||||
from utilities.forms.bulk_import import BulkImportForm
|
||||
from utilities.forms.forms import BulkRenameForm
|
||||
from utilities.forms.utils import expand_alphanumeric_pattern, expand_ipaddress_pattern
|
||||
|
||||
|
||||
@ -364,3 +365,16 @@ class ImportFormTest(TestCase):
|
||||
{'a': '1', 'b': '2', 'c': '3'},
|
||||
{'a': '4', 'b': '5', 'c': '6'},
|
||||
])
|
||||
|
||||
|
||||
class BulkRenameFormTest(TestCase):
|
||||
def test_no_strip_whitespace(self):
|
||||
# Tests to make sure Bulk Rename Form isn't stripping whitespaces
|
||||
# See: https://github.com/netbox-community/netbox/issues/13791
|
||||
form = BulkRenameForm(data={
|
||||
"find": " hello ",
|
||||
"replace": " world "
|
||||
})
|
||||
self.assertTrue(form.is_valid())
|
||||
self.assertEqual(form.cleaned_data["find"], " hello ")
|
||||
self.assertEqual(form.cleaned_data["replace"], " world ")
|
||||
|
Loading…
Reference in New Issue
Block a user