Skip to content

Commit

Permalink
[#29] Rename DataPackagerPackageController -> DataPackageController
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorbaptista committed Dec 16, 2015
1 parent cb34453 commit 714e37d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import ckan.plugins.toolkit as toolkit


class DataPackagerPackageController(toolkit.BaseController):
class DataPackageController(toolkit.BaseController):

def new(self):
return toolkit.render('data_package/import_data_package.html')
Expand Down
6 changes: 3 additions & 3 deletions ckanext/datapackager/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ def before_map(self, map_):
map_.connect(
'import_data_package',
'/import_data_package',
controller='ckanext.datapackager.controllers.package:DataPackagerPackageController',
controller='ckanext.datapackager.controllers.data_package:DataPackageController',
action='new',
conditions=dict(method=['GET']),
)
map_.connect(
'import_data_package',
'/import_data_package',
controller='ckanext.datapackager.controllers.package:DataPackagerPackageController',
controller='ckanext.datapackager.controllers.data_package:DataPackageController',
action='import_data_package',
conditions=dict(method=['POST']),
)
map_.connect(
'download_tabular_data_format',
'/dataset/{package_id}/download_tabular_data_format',
controller='ckanext.datapackager.controllers.package:DataPackagerPackageController',
controller='ckanext.datapackager.controllers.data_package:DataPackageController',
action='download_tabular_data_format'
)
return map_
Expand Down
2 changes: 1 addition & 1 deletion ckanext/datapackager/templates/package/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block primary_content_inner %}
<div style="float:right; margin-left:10px">
<a href="{% url_for controller='ckanext.datapackager.controllers.package:DataPackagerPackageController', action='download_tabular_data_format', package_id=pkg.name %}"
<a href="{% url_for 'download_tabular_data_format', package_id=pkg.name %}"
class='btn btn-primary', id='download_tdf_button'>
<i class='icon-download'></i>Download Data Package
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
import ckanext.datapackager.tests.helpers as custom_helpers


class TestDataPackagerPackageController(
class TestDataPackageController(
custom_helpers.FunctionalTestBaseClass):
'''Functional tests for the DataPackagerPackageController class.'''
'''Functional tests for the DataPackageController class.'''

@httpretty.activate
def test_download_tdf(self):
Expand Down Expand Up @@ -46,7 +46,7 @@ def test_download_tdf(self):

# Download the package's SDF ZIP file.
url = toolkit.url_for(
controller='ckanext.datapackager.controllers.package:DataPackagerPackageController',
controller='ckanext.datapackager.controllers.data_package:DataPackageController',
action='download_tabular_data_format',
package_id=dataset['name'])
response = self.app.get(url)
Expand Down Expand Up @@ -105,7 +105,7 @@ def filename_inside_package(path):

# Download the package's SDF ZIP file.
url = toolkit.url_for(
controller='ckanext.datapackager.controllers.package:DataPackagerPackageController',
controller='ckanext.datapackager.controllers.data_package:DataPackageController',
action='download_tabular_data_format',
package_id=dataset['name'])
response = self.app.get(url)
Expand Down Expand Up @@ -141,6 +141,6 @@ def test_that_download_button_is_on_page(self):
download_button = soup.find(id='download_tdf_button')
download_url = download_button['href']
assert download_url == toolkit.url_for(
controller='ckanext.datapackager.controllers.package:DataPackagerPackageController',
controller='ckanext.datapackager.controllers.data_package:DataPackageController',
action='download_tabular_data_format',
package_id=dataset['name'])

0 comments on commit 714e37d

Please sign in to comment.