Skip to content

Commit

Permalink
[#1792] PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorbaptista committed Jul 3, 2014
1 parent 85ea7f3 commit 5e93512
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ckan/logic/action/create.py
Expand Up @@ -327,8 +327,8 @@ def resource_view_create(context, data_dict):
)}
)

schema = (context.get('schema') or
ckan.logic.schema.default_create_resource_view_schema(view_plugin))
default = logic.schema.default_create_resource_view_schema(view_plugin)
schema = context.get('schema', default)
plugin_schema = view_plugin.info().get('schema', {})
schema.update(plugin_schema)

Expand Down
4 changes: 2 additions & 2 deletions ckan/new_tests/logic/action/test_create.py
Expand Up @@ -191,7 +191,7 @@ def test_filterable_views_converts_filter_fields_and_values_to_list(self, datapr
result = helpers.call_action('resource_view_create', context, **params)
assert_equals(result['filter_fields'], ['country'])
assert_equals(result['filter_values'], ['Brazil'])
assert_equals(result['filters'], { 'country': ['Brazil'] })
assert_equals(result['filters'], {'country': ['Brazil']})

@mock.patch('ckan.lib.datapreview')
def test_filterable_views_require_filter_fields_and_values_to_have_same_length(self, datapreview_mock):
Expand Down Expand Up @@ -229,7 +229,7 @@ def _default_resource_view_attributes(self, **kwargs):

def _configure_datapreview_to_return_filterable_view(self, datapreview_mock):
filterable_view = mock.MagicMock()
filterable_view.info.return_value = { 'filterable': True }
filterable_view.info.return_value = {'filterable': True}
datapreview_mock.get_view_plugin.return_value = filterable_view


Expand Down
2 changes: 1 addition & 1 deletion ckan/new_tests/logic/action/test_update.py
Expand Up @@ -415,7 +415,7 @@ def test_resource_view_update(self):
@mock.patch('ckan.lib.datapreview')
def test_filterable_views_converts_filter_fields_and_values_into_filters_dict(self, datapreview_mock):
filterable_view = mock.MagicMock()
filterable_view.info.return_value = { 'filterable': True }
filterable_view.info.return_value = {'filterable': True}
datapreview_mock.get_view_plugin.return_value = filterable_view
resource_view = factories.ResourceView()
context = {}
Expand Down

0 comments on commit 5e93512

Please sign in to comment.