From ce3c58815ce19f0581fca211ed382393ac7b3a33 Mon Sep 17 00:00:00 2001 From: Ross Jones Date: Wed, 23 May 2012 10:37:59 +0100 Subject: [PATCH] 2413 Removes autoneg from dependencies and traces of it from code. --- ckan/controllers/package.py | 9 ---- ckan/tests/functional/test_autoneg.py | 76 --------------------------- requires/lucid_missing.txt | 2 - 3 files changed, 87 deletions(-) delete mode 100644 ckan/tests/functional/test_autoneg.py diff --git a/ckan/controllers/package.py b/ckan/controllers/package.py index c63b56321bc..de7ab0c528a 100644 --- a/ckan/controllers/package.py +++ b/ckan/controllers/package.py @@ -4,7 +4,6 @@ from pylons import config from pylons.i18n import _ -from autoneg.accept import negotiate from ckan.logic import get_action, check_access from ckan.lib.helpers import date_str_to_datetime @@ -38,14 +37,6 @@ def search_url(params): url = h.url_for(controller='package', action='search') return url_with_params(url, params) -autoneg_cfg = [ - ("application", "xhtml+xml", ["html"]), - ("text", "html", ["html"]), - ("application", "rdf+xml", ["rdf"]), - ("application", "turtle", ["ttl"]), - ("text", "plain", ["nt"]), - ("text", "x-graphviz", ["dot"]), - ] class PackageController(BaseController): diff --git a/ckan/tests/functional/test_autoneg.py b/ckan/tests/functional/test_autoneg.py deleted file mode 100644 index 0d1181498a1..00000000000 --- a/ckan/tests/functional/test_autoneg.py +++ /dev/null @@ -1,76 +0,0 @@ -import cgi - -from paste.fixture import AppError -from pylons import config -from pylons import c -from genshi.core import escape as genshi_escape -from difflib import unified_diff -from nose.plugins.skip import SkipTest - -from ckan.tests import * -from ckan.tests.html_check import HtmlCheckMethods -from ckan.tests.pylons_controller import PylonsTestCase -from ckan.lib.create_test_data import CreateTestData -from ckan import model -from test_package import TestPackageForm as _TestPackageForm - -class TestAutoneg(_TestPackageForm, PylonsTestCase): - @classmethod - def setup_class(cls): - PylonsTestCase.setup_class() - CreateTestData.create() - - @classmethod - def teardown_class(cls): - model.repo.rebuild_db() - - def test_default(self): - url = url_for(controller='package', action='read', id='annakarenina') - response = self.app.get(url) - assert response.status == 200, response.status - content_type = response.header("Content-Type") - assert "html" in content_type, content_type - - def test_chrome(self): - url = url_for(controller='package', action='read', id='annakarenina') - ## this is what chrome sends... notice how it prefers pictures of web pages - ## to web pages - accept = "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" - response = self.app.get(url, headers={"Accept": accept}) - assert response.status == 200, response.status - content_type = response.header("Content-Type") - assert "html" in content_type, content_type - - def test_firefox(self): - url = url_for(controller='package', action='read', id='annakarenina') - ## this is what firefox sends - accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" - response = self.app.get(url, headers={"Accept": accept}) - assert response.status == 200, response.status - content_type = response.header("Content-Type") - assert "html" in content_type, content_type - - def test_html_rdf(self): - url = url_for(controller='package', action='read', id='annakarenina') - ## this is an important test. rdf appears first, but with a lower priority - ## than html. we expect to get html back - accept = "application/rdf+xml;q=0.5,application/xhtml+xml,text/html;q=0.9" - response = self.app.get(url, headers={"Accept": accept}) - assert response.status == 200, response.status - content_type = response.header("Content-Type") - assert "html" in content_type, content_type - - def test_rdfxml(self): - url = url_for(controller='package', action='read', id='annakarenina') - response = self.app.get(url, headers={"Accept": "application/rdf+xml"}) - assert response.status == 200, response.status - ctype = response.header("Content-Type") - assert 'application/rdf+xml' in ctype, ctype - - def test_n3(self): - url = url_for(controller='package', action='read', id='annakarenina') - response = self.app.get(url, headers={"Accept": "text/n3"}) - assert response.status == 200, response.status - ctype = response.header("Content-Type") - assert 'text/n3' in ctype, ctype - diff --git a/requires/lucid_missing.txt b/requires/lucid_missing.txt index 8b5789e08c8..7aaf1f1d3fd 100644 --- a/requires/lucid_missing.txt +++ b/requires/lucid_missing.txt @@ -6,8 +6,6 @@ -e svn+https://software.sandia.gov/svn/public/pyutilib/pyutilib.component.core/trunk@1972#egg=pyutilib.component.core # vdm>=0.10,<0.11.99 -e git+https://github.com/okfn/vdm.git@vdm-0.11#egg=vdm -# autoneg>=0.5 --e git+https://github.com/wwaites/autoneg.git@b4c727b164f411cc9d60#egg=autoneg # flup>=0.5 -e hg+http://hg.saddi.com/flup@301a58656bfb#egg=flup