Skip to content

Commit

Permalink
[#953] fix datastore tests
Browse files Browse the repository at this point in the history
create an organization in setup and use it in package_create
  • Loading branch information
joetsoi authored and amercader committed Jul 1, 2013
1 parent 40a408b commit 2676bb2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ckanext/datastore/tests/test_search.py
Expand Up @@ -49,6 +49,12 @@ def setup_class(cls):
res_dict = json.loads(res.body)
assert res_dict['success'] is True

# Make an organization, because private datasets must belong to one.
cls.organization = tests.call_action_api(
cls.app, 'organization_create',
name='test_org',
apikey=cls.sysadmin_user.apikey)

cls.expected_records = [{u'published': u'2005-03-01T00:00:00',
u'_id': 1,
u'nested': [u'b', {u'moo': u'moo'}],
Expand Down Expand Up @@ -106,6 +112,7 @@ def test_search_private_dataset(self):
context,
{'name': 'privatedataset',
'private': True,
'owner_org' : self.organization['id'],
'groups': [{
'id': group.id
}]})
Expand Down Expand Up @@ -503,6 +510,12 @@ def setup_class(cls):
extra_environ=auth)
res_dict = json.loads(res.body)
assert res_dict['success'] is True

# Make an organization, because private datasets must belong to one.
cls.organization = tests.call_action_api(
cls.app, 'organization_create',
name='test_org',
apikey=cls.sysadmin_user.apikey)

cls.expected_records = [{u'_full_text': u"'annakarenina':1 'b':3 'moo':4 'tolstoy':2",
u'_id': 1,
Expand Down Expand Up @@ -637,6 +650,7 @@ def test_new_datastore_table_from_private_resource(self):
context,
{'name': 'privatedataset',
'private': True,
'owner_org': self.organization['id'],
'groups': [{
'id': group.id
}]})
Expand Down Expand Up @@ -676,6 +690,7 @@ def test_making_resource_private_makes_datastore_private(self):
context,
{'name': 'privatedataset2',
'private': False,
'owner_org': self.organization['id'],
'groups': [{
'id': group.id
}]})
Expand Down

0 comments on commit 2676bb2

Please sign in to comment.