Skip to content

Commit

Permalink
[controllers, tests]: ckan#1088 Fix test broken in previous commit. N…
Browse files Browse the repository at this point in the history
…ow treats blank rdf_packages configuration the same as not configured - does not display RDF link (it did erroneously for blank value before).
  • Loading branch information
David Read committed May 31, 2011
1 parent d11045c commit 435dc98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ckan/controllers/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def read(self, id):
# used by disqus plugin
c.current_package_id = c.pkg.id

if config.get('rdf_packages') is not None:
if config.get('rdf_packages'):
accept_header = request.headers.get('Accept', '*/*')
for content_type, exts in negotiate(autoneg_cfg, accept_header):
if "html" not in exts:
Expand Down
2 changes: 2 additions & 0 deletions ckan/tests/functional/test_autoneg.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ def test_rdfxml(self):
assert response.status == 303, response.status
location = response.header("Location")
assert location.endswith(".rdf"), location
assert location.startswith('http://test.com/package/'), location

def test_turtle(self):
url = url_for(controller='package', action='read', id='annakarenina')
response = self.app.get(url, headers={"Accept": "application/turtle"})
assert response.status == 303, response.status
location = response.header("Location")
assert location.endswith(".ttl"), location
assert location.startswith('http://test.com/package/'), location

2 changes: 1 addition & 1 deletion test-core.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ carrot_messaging_library = queue
ckan.site_url = http://test.ckan.net
package_new_return_url = http://localhost/package/<NAME>?test=new
package_edit_return_url = http://localhost/package/<NAME>?test=edit

rdf_packages = http://test.com/package/
ckan.extra_resource_fields = alt_url

# disable this so we can test all types of indexing
Expand Down

0 comments on commit 435dc98

Please sign in to comment.