[ckan-changes] commit/ckan: dread: [controllers, tests]: #1088 Fix test broken in previous commit. Now treats blank rdf_packages configuration the same as not configured - does not display RDF link (it did erroneously for blank value before).

Bitbucket commits-noreply at bitbucket.org
Tue May 31 13:49:58 UTC 2011


1 new changeset in ckan:

http://bitbucket.org/okfn/ckan/changeset/fc600dedfb74/
changeset:   fc600dedfb74
branches:    
user:        dread
date:        2011-05-31 15:49:41
summary:     [controllers, tests]: #1088 Fix test broken in previous commit. Now treats blank rdf_packages configuration the same as not configured - does not display RDF link (it did erroneously for blank value before).
affected #:  3 files (197 bytes)

--- a/ckan/controllers/package.py	Tue May 31 12:46:01 2011 +0100
+++ b/ckan/controllers/package.py	Tue May 31 14:49:41 2011 +0100
@@ -187,7 +187,7 @@
         # 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: 


--- a/ckan/tests/functional/test_autoneg.py	Tue May 31 12:46:01 2011 +0100
+++ b/ckan/tests/functional/test_autoneg.py	Tue May 31 14:49:41 2011 +0100
@@ -66,6 +66,7 @@
         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')
@@ -73,4 +74,5 @@
         assert response.status == 303, response.status
         location = response.header("Location")
         assert location.endswith(".ttl"), location
+        assert location.startswith('http://test.com/package/'), location
 


--- a/test-core.ini	Tue May 31 12:46:01 2011 +0100
+++ b/test-core.ini	Tue May 31 14:49:41 2011 +0100
@@ -29,7 +29,7 @@
 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

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list