diff --git a/ckan/__init__.py b/ckan/__init__.py
index b4333195546..b1b15441a63 100644
--- a/ckan/__init__.py
+++ b/ckan/__init__.py
@@ -1,4 +1,4 @@
-__version__ = '1.6.1b'
+__version__ = '1.8a'
__description__ = 'Comprehensive Knowledge Archive Network (CKAN) Software'
__long_description__ = \
'''CKAN software provides a hub for datasets. The flagship site running CKAN
diff --git a/ckan/config/solr/CHANGELOG.txt b/ckan/config/solr/CHANGELOG.txt
index 5fe664fc8f8..1e4e67f6ff6 100644
--- a/ckan/config/solr/CHANGELOG.txt
+++ b/ckan/config/solr/CHANGELOG.txt
@@ -1,6 +1,14 @@
CKAN SOLR schemas changelog
===========================
+v1.4 - (ckan>=1.7)
+--------------------
+* Add Ascii folding filter to text fields.
+* Add capacity field for public, private access.
+* Add title_string so you can sort alphabetically on title.
+* Fields related to analytics, access and view counts.
+* Add data_dict field for the whole package_dict.
+
v1.3 - (ckan>=1.5.1)
--------------------
* Use the index_id (hash of dataset id + site_id) as uniqueKey (#1430)
diff --git a/ckan/config/solr/schema-1.4.xml b/ckan/config/solr/schema-1.4.xml
index 29cb4737287..0409e71b14b 100644
--- a/ckan/config/solr/schema-1.4.xml
+++ b/ckan/config/solr/schema-1.4.xml
@@ -51,6 +51,7 @@
There\'s no graph here yet because we don\'t know what fields you\'d like to see plotted.
\ +Please tell us by using the menu on the right and a graph will automatically appear.
\ +
${c.page.item_count} users found.
diff --git a/ckan/templates/user/login.html b/ckan/templates/user/login.html
index 6cabb81b0fe..9fdf3df1f39 100644
--- a/ckan/templates/user/login.html
+++ b/ckan/templates/user/login.html
@@ -18,25 +18,39 @@
You have logged out successfully.
diff --git a/ckan/tests/functional/test_search.py b/ckan/tests/functional/test_search.py index fe1802c76bf..a9a93398472 100644 --- a/ckan/tests/functional/test_search.py +++ b/ckan/tests/functional/test_search.py @@ -108,7 +108,7 @@ def test_search_foreign_chars(self): res = self.app.get(offset) assert 'Search - ' in res self._check_search_results(res, u'th\xfcmb', ['1']) - self._check_search_results(res, 'thumb', ['0']) + self._check_search_results(res, 'thumb', ['1']) @search_related def test_search_escape_chars(self): diff --git a/ckan/tests/functional/test_user.py b/ckan/tests/functional/test_user.py index 5ab1efcb599..eb44bd92376 100644 --- a/ckan/tests/functional/test_user.py +++ b/ckan/tests/functional/test_user.py @@ -168,11 +168,14 @@ def test_login(self): fv = res.forms['login'] fv['login'] = str(username) fv['password'] = str(password) + fv['remember'] = False res = fv.submit() # check cookies set cookies = self._get_cookie_headers(res) assert cookies + for cookie in cookies: + assert not 'max-age' in cookie.lower(), cookie # first get redirected to user/logged_in assert_equal(res.status, 302) @@ -206,6 +209,32 @@ def test_login(self): print res assert 'testlogin' in res.body, res.body + def test_login_remembered(self): + # create test user + username = u'testlogin2' + password = u'letmein' + CreateTestData.create_user(name=username, + password=password) + user = model.User.by_name(username) + + # do the login + offset = url_for(controller='user', action='login') + res = self.app.get(offset) + fv = res.forms['login'] + fv['login'] = str(username) + fv['password'] = str(password) + fv['remember'] = True + res = fv.submit() + + # check cookies set + cookies = self._get_cookie_headers(res) + assert cookies + # check cookie is remembered via Max-Age and Expires + # (both needed for cross-browser compatibility) + for cookie in cookies: + assert 'Max-Age=63072000;' in cookie, cookie + assert 'Expires=' in cookie, cookie + def test_login_wrong_password(self): # create test user username = u'testloginwrong' diff --git a/ckan/tests/lib/test_alphabet_pagination.py b/ckan/tests/lib/test_alphabet_pagination.py index a1bf6ae4749..8afc27642b4 100644 --- a/ckan/tests/lib/test_alphabet_pagination.py +++ b/ckan/tests/lib/test_alphabet_pagination.py @@ -1,5 +1,7 @@ import re +from nose.tools import assert_equal + from ckan.tests import * from ckan.tests import regex_related from ckan.lib.create_test_data import CreateTestData @@ -28,6 +30,16 @@ def setup_class(cls): def teardown_class(cls): model.repo.rebuild_db() + def test_00_model(self): + query = model.Session.query(model.Package) + page = h.AlphaPage( + collection=query, + alpha_attribute='title', + page='A', + other_text=other, + ) + assert_equal(page.available, {'Other': 20, 'A': 10, 'C': 10, 'B': 10, 'E': 0, 'D': 10, 'G': 0, 'F': 0, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'M': 0, 'L': 0, 'O': 0, 'N': 0, 'Q': 0, 'P': 0, 'S': 0, 'R': 0, 'U': 0, 'T': 0, 'W': 0, 'V': 0, 'Y': 0, 'X': 0, 'Z': 0}) + def test_01_package_page(self): query = model.Session.query(model.Package) page = h.AlphaPage( @@ -37,11 +49,12 @@ def test_01_package_page(self): other_text=other, ) pager = page.pager() - assert pager.startswith('