From 3163bfcf0ff8a48b84dac7fdc6ed7e3783f90f6c Mon Sep 17 00:00:00 2001 From: amercader Date: Thu, 20 Dec 2012 11:24:09 +0000 Subject: [PATCH] [#3022] Fix failing test due to default package type --- ckan/tests/lib/test_dictization.py | 9 ++++----- ckan/tests/lib/test_dictization_schema.py | 1 + ckan/tests/lib/test_solr_search_index.py | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ckan/tests/lib/test_dictization.py b/ckan/tests/lib/test_dictization.py index 296cac002a6..b356bfc8215 100644 --- a/ckan/tests/lib/test_dictization.py +++ b/ckan/tests/lib/test_dictization.py @@ -68,7 +68,7 @@ def setup_class(cls): 'organization': None, 'maintainer': None, 'maintainer_email': None, - 'type': None, + 'type': u'dataset', 'name': u'annakarenina', 'notes': u'Some test notes\n\n### A 3rd level heading\n\n**Some bolded text.**\n\n*Some italicized text.*\n\nForeign characters:\nu with umlaut \xfc\n66-style quote \u201c\nforeign word: th\xfcmb\n\nNeeds escaping:\nleft arrow <\n\n\n\n', 'relationships_as_object': [], @@ -175,7 +175,7 @@ def test_01_dictize_main_objects_simple(self): 'notes': u'Some test notes\n\n### A 3rd level heading\n\n**Some bolded text.**\n\n*Some italicized text.*\n\nForeign characters:\nu with umlaut \xfc\n66-style quote \u201c\nforeign word: th\xfcmb\n\nNeeds escaping:\nleft arrow <\n\n\n\n', 'state': u'active', 'title': u'A Novel By Tolstoy', - 'type': None, + 'type': u'dataset', 'url': u'http://www.annakarenina.com', 'owner_org': None, 'private': False, @@ -932,7 +932,7 @@ def test_16_group_dictized(self): 'license_id': u'other-open', 'maintainer': None, 'maintainer_email': None, - 'type': None, + 'type': u'dataset', 'name': u'annakarenina3', 'notes': u'Some test notes\n\n### A 3rd level heading\n\n**Some bolded text.**\n\n*Some italicized text.*\n\nForeign characters:\nu with umlaut \xfc\n66-style quote \u201c\nforeign word: th\xfcmb\n\nNeeds escaping:\nleft arrow <\n\n\n\n', 'state': u'active', @@ -949,7 +949,7 @@ def test_16_group_dictized(self): 'license_id': u'other-open', 'maintainer': None, 'maintainer_email': None, - 'type': None, + 'type': u'dataset', 'name': u'annakarenina2', 'notes': u'Some test notes\n\n### A 3rd level heading\n\n**Some bolded text.**\n\n*Some italicized text.*\n\nForeign characters:\nu with umlaut \xfc\n66-style quote \u201c\nforeign word: th\xfcmb\n\nNeeds escaping:\nleft arrow <\n\n\n\n', 'state': u'active', @@ -962,7 +962,6 @@ def test_16_group_dictized(self): 'approval_status': u'approved', 'title': u'help', 'type': u'group'} - expected['packages'] = sorted(expected['packages'], key=lambda x: x['name']) result = self.remove_changable_columns(group_dictized) result['packages'] = sorted(result['packages'], key=lambda x: x['name']) diff --git a/ckan/tests/lib/test_dictization_schema.py b/ckan/tests/lib/test_dictization_schema.py index 61bda75f2db..fd99e44f115 100644 --- a/ckan/tests/lib/test_dictization_schema.py +++ b/ckan/tests/lib/test_dictization_schema.py @@ -81,6 +81,7 @@ def test_1_package_schema(self): }], 'license_id': u'other-open', 'name': u'anna2', + 'type': u'dataset', 'notes': u'Some test notes\n\n### A 3rd level heading\n\n**Some bolded text.**\n\n*Some italicized text.*\n\nForeign characters:\nu with umlaut \xfc\n66-style quote \u201c\nforeign word: th\xfcmb\n\nNeeds escaping:\nleft arrow <\n\n\n\n', 'resources': [{'alt_url': u'alt123', 'description': u'Full text. Needs escaping: " Umlaut: \xfc', diff --git a/ckan/tests/lib/test_solr_search_index.py b/ckan/tests/lib/test_solr_search_index.py index 4935eed850a..8a14ef2b657 100644 --- a/ckan/tests/lib/test_solr_search_index.py +++ b/ckan/tests/lib/test_solr_search_index.py @@ -60,6 +60,7 @@ def test_index(self): 'id': u'penguin-id', 'title': u'penguin', 'state': u'active', + 'type': u'dataset', 'private': False, 'owner_org': None, 'metadata_created': datetime_now.isoformat(), @@ -89,6 +90,7 @@ def test_index_clear(self): 'id': u'penguin-id', 'title': u'penguin', 'state': u'active', + 'type': u'dataset', 'private': False, 'owner_org': None, 'metadata_created': datetime.now().isoformat(), @@ -112,6 +114,7 @@ def test_index_illegal_xml_chars(self): 'title': u'\u00c3a\u0001ltimo n\u00famero penguin', 'notes': u'\u00c3a\u0001ltimo n\u00famero penguin', 'state': u'active', + 'type': u'dataset', 'private': False, 'owner_org': None, 'metadata_created': datetime.now().isoformat(),