diff --git a/dash/development/_r_components_generation.py b/dash/development/_r_components_generation.py index 13a57af381..621c9d151e 100644 --- a/dash/development/_r_components_generation.py +++ b/dash/development/_r_components_generation.py @@ -25,8 +25,8 @@ ) component$props <- filter_null(component$props) - - structure(component, class = c('dash_component', 'list')) + + structure(component, class = c('dash_component', 'list')) }}''' # noqa:E501 # the following strings represent all the elements in an object diff --git a/dash/development/component_generator.py b/dash/development/component_generator.py index 31f9d1ce9a..99c19051a0 100644 --- a/dash/development/component_generator.py +++ b/dash/development/component_generator.py @@ -146,11 +146,13 @@ def cli(): # pylint: disable=undefined-variable def byteify(input_object): if isinstance(input_object, dict): - return {byteify(key): byteify(value) - for key, value in input_object.iteritems()} + return OrderedDict([ + (byteify(key), byteify(value)) + for key, value in input_object.iteritems() + ]) elif isinstance(input_object, list): return [byteify(element) for element in input_object] - elif isinstance(input_object, unicode): # noqa:F821 + elif isinstance(input_object, unicode): # noqa:F821 return input_object.encode('utf-8') return input_object diff --git a/tests/development/test_base_component.py b/tests/development/test_base_component.py index 1fcfa06f9c..a19768a3dc 100644 --- a/tests/development/test_base_component.py +++ b/tests/development/test_base_component.py @@ -280,7 +280,7 @@ def test_set_item_with_nested_children(self): c3b = Component(id='3') self.assertEqual(c5['3'], c3) - self.assertTrue(c5['3'] is not '3') + self.assertTrue(c5['3'] != '3') self.assertTrue(c5['3'] is not c3b) c5['3'] = c3b