diff --git a/ckan/lib/create_test_data.py b/ckan/lib/create_test_data.py index d5f26c47e51..c63d6e1eb40 100644 --- a/ckan/lib/create_test_data.py +++ b/ckan/lib/create_test_data.py @@ -355,7 +355,7 @@ def create(cls, commit_changesets=False): pkg2.tags = [ tag1 ] cls.tag_names = [u'russian', u'tolstoy'] pkg1.license_id = u'other-open' - pkg2.license_id = u'cc-by' + pkg2.license_id = u'cc-nc' # closed license pkg2.title = u'A Wonderful Story' pkg1.extras = {u'genre':'romantic novel', u'original media':'book'} diff --git a/ckan/tests/forms/test_group.py b/ckan/tests/forms/test_group.py index 3f07e63b798..cfc79132f24 100644 --- a/ckan/tests/forms/test_group.py +++ b/ckan/tests/forms/test_group.py @@ -6,6 +6,7 @@ class TestGroupFieldset(PylonsTestCase): @classmethod def setup_class(self): + PylonsTestCase.setup_class() ckan.tests.CreateTestData.create() @classmethod diff --git a/ckan/tests/functional/test_package.py b/ckan/tests/functional/test_package.py index 4ba4db0ffe6..58b07ce9132 100644 --- a/ckan/tests/functional/test_package.py +++ b/ckan/tests/functional/test_package.py @@ -256,10 +256,11 @@ def _check_redirect(self, return_url_param, expected_redirect, pkg.purge() model.repo.commit_and_remove() -class TestReadOnly(TestPackageForm, HtmlCheckMethods, TestSearchIndexer): +class TestReadOnly(TestPackageForm, HtmlCheckMethods, TestSearchIndexer, PylonsTestCase): @classmethod def setup_class(cls): + PylonsTestCase.setup_class() cls.tsi = TestSearchIndexer() CreateTestData.create() cls.tsi.index() @@ -294,7 +295,7 @@ def test_read(self): for pkg_ in (pkg_by_name_main, pkg_by_id_main): pkg_ = pkg_.replace(txt, 'placeholder') res_diff = self.diff_html(pkg_by_name_main, pkg_by_id_main) - assert not res_diff, res_diff + assert not res_diff, res_diff.encode('utf8') # not true as language selection link return url differs: #assert len(res_by_id.body) == len(res.body) @@ -342,8 +343,11 @@ def test_read_internal_links(self): offset = url_for(controller='package', action='read', id=pkg_name) res = self.app.get(offset) def check_link(res, controller, id): - link = '%s:%s' % (controller, id, controller, id) - assert link in res, self.main_div(res) + link + link = '%s:%s' % (controller, id, controller, id) + if link not in res: + print self.main_div(res).encode('utf8') + print 'Missing link: %r' % link + raise AssertionError check_link(res, 'package', 'pkg-1') check_link(res, 'tag', 'tag_1') check_link(res, 'group', 'test-group-1') diff --git a/ckan/tests/functional/test_user.py b/ckan/tests/functional/test_user.py index 6779de284bb..7ba7c9acb81 100644 --- a/ckan/tests/functional/test_user.py +++ b/ckan/tests/functional/test_user.py @@ -35,7 +35,7 @@ def test_user_read(self): main_res = self.main_div(res) assert 'annafan - User' in res, res assert 'Logged in' not in main_res, main_res - assert 'About' in main_res, main_res + assert 'about' in main_res, main_res assert 'I love reading Annakarenina' in res, main_res assert 'Edit' not in main_res, main_res assert 'Number of edits: 3' in res, res diff --git a/ckan/tests/html_check.py b/ckan/tests/html_check.py index 713ad0d81ed..2136adfedef 100644 --- a/ckan/tests/html_check.py +++ b/ckan/tests/html_check.py @@ -11,7 +11,11 @@ class HtmlCheckMethods(object): def named_div(self, div_name, html): 'strips html to just the