Merge branch 'develop' into develop-2.9

This commit is contained in:
Jeremy Stretch
2020-07-08 13:04:57 -04:00
7 changed files with 73 additions and 23 deletions

View File

@@ -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 = {