mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #4835: Support passing multiple initial values for multiple choice fields
This commit is contained in:
@ -1,15 +1,13 @@
|
||||
from django.http import QueryDict
|
||||
from django.test import TestCase
|
||||
|
||||
from utilities.utils import deepmerge, dict_to_filter_params
|
||||
from utilities.utils import deepmerge, dict_to_filter_params, normalize_querydict
|
||||
|
||||
|
||||
class DictToFilterParamsTest(TestCase):
|
||||
"""
|
||||
Validate the operation of dict_to_filter_params().
|
||||
"""
|
||||
def setUp(self):
|
||||
return
|
||||
|
||||
def test_dict_to_filter_params(self):
|
||||
|
||||
input = {
|
||||
@ -39,13 +37,21 @@ class DictToFilterParamsTest(TestCase):
|
||||
self.assertNotEqual(dict_to_filter_params(input), output)
|
||||
|
||||
|
||||
class NormalizeQueryDictTest(TestCase):
|
||||
"""
|
||||
Validate normalize_querydict() utility function.
|
||||
"""
|
||||
def test_normalize_querydict(self):
|
||||
self.assertDictEqual(
|
||||
normalize_querydict(QueryDict('foo=1&bar=2&bar=3&baz=')),
|
||||
{'foo': '1', 'bar': ['2', '3'], 'baz': ''}
|
||||
)
|
||||
|
||||
|
||||
class DeepMergeTest(TestCase):
|
||||
"""
|
||||
Validate the behavior of the deepmerge() utility.
|
||||
"""
|
||||
def setUp(self):
|
||||
return
|
||||
|
||||
def test_deepmerge(self):
|
||||
|
||||
dict1 = {
|
||||
|
Reference in New Issue
Block a user