diff --git a/ckan/config/resource_formats.json b/ckan/config/resource_formats.json index a83dc8b3e37..0cf6fb92eaa 100644 --- a/ckan/config/resource_formats.json +++ b/ckan/config/resource_formats.json @@ -18,7 +18,7 @@ ["MDB", "Access Database", "application/x-msaccess", []], ["NetCDF", "NetCDF File", "application/netcdf", []], ["ArcGIS Map Service", "ArcGIS Map Service", "ArcGIS Map Service", ["arcgis map service"]], - ["TSV", "Tab Separated Values File", "text/tsv", []], + ["TSV", "Tab Separated Values File", "text/tsv", ["text/tab-separated-values"]], ["WFS", "Web Feature Service", null, []], ["ArcGIS Online Map", "ArcGIS Online Map", "ArcGIS Online Map", ["web map application"]], ["Perl", "Perl Script", "text/x-perl", []], diff --git a/ckan/tests/lib/test_helpers.py b/ckan/tests/lib/test_helpers.py index a1175dddc20..69e3f48b97b 100644 --- a/ckan/tests/lib/test_helpers.py +++ b/ckan/tests/lib/test_helpers.py @@ -109,3 +109,12 @@ def test_includes_existing_license(self): eq_(dict(licenses)['some-old-license'], 'some-old-license') # and it is first on the list eq_(licenses[0][0], 'some-old-license') + + +class TestResourceFormat(object): + + def test_autodetect_tsv(self): + + eq_(h.unified_resource_format('tsv'), 'TSV') + + eq_(h.unified_resource_format('text/tab-separated-values'), 'TSV')