mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 05:28:16 -06:00
14467 fix test
This commit is contained in:
parent
010721ed07
commit
df82f782be
@ -120,6 +120,31 @@ class CustomFieldChoiceSetTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|||||||
'description': 'New description',
|
'description': 'New description',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# These are here as extra_choices field splits on colon, but is returned
|
||||||
|
# from DB as comma separated. So we exclude them in validation_excluded_fields
|
||||||
|
# but test they are actually set correctly here.
|
||||||
|
def _check_extra_choices_data(self):
|
||||||
|
instance = self._get_queryset().last()
|
||||||
|
form_data = self.form_data
|
||||||
|
form_data['extra_choices'] = form_data['extra_choices'].replace(':', ',')
|
||||||
|
self.assertInstanceEqual(instance, form_data)
|
||||||
|
|
||||||
|
def test_create_object_with_constrained_permission(self):
|
||||||
|
super().test_create_object_with_constrained_permission()
|
||||||
|
self._check_extra_choices_data()
|
||||||
|
|
||||||
|
def test_create_object_with_permission(self):
|
||||||
|
super().test_create_object_with_permission()
|
||||||
|
self._check_extra_choices_data()
|
||||||
|
|
||||||
|
def test_edit_object_with_constrained_permission(self):
|
||||||
|
super().test_edit_object_with_constrained_permission()
|
||||||
|
self._check_extra_choices_data()
|
||||||
|
|
||||||
|
def test_edit_object_with_permission(self):
|
||||||
|
super().test_edit_object_with_permission()
|
||||||
|
self._check_extra_choices_data()
|
||||||
|
|
||||||
|
|
||||||
class CustomLinkTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
class CustomLinkTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
||||||
model = CustomLink
|
model = CustomLink
|
||||||
|
Loading…
Reference in New Issue
Block a user