Skip to content

Commit

Permalink
test user removed when using API callbacks
Browse files Browse the repository at this point in the history
Conflicts:
	ckan/tests/controllers/test_api.py
  • Loading branch information
wardi authored and amercader committed Dec 16, 2015
1 parent 067514f commit da620a4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions ckan/tests/controllers/test_api.py
Expand Up @@ -166,3 +166,35 @@ def test_organization_autocomplete_by_title(self):
results = json.loads(response.body)
assert_equal(len(results), 1)
assert_equal(results[0]['title'], 'Simple dummy org')

def test_config_option_list_access_sysadmin(self):
user = factories.Sysadmin()
url = url_for(
controller='api',
action='action',
logic_function='config_option_list',
ver='/3')
app = self._get_test_app()

app.get(
url=url,
params={},
extra_environ={'REMOTE_USER': user['name'].encode('ascii')},
status=200,
)

def test_config_option_list_access_sysadmin_jsonp(self):
user = factories.Sysadmin()
url = url_for(
controller='api',
action='action',
logic_function='config_option_list',
ver='/3')
app = self._get_test_app()

app.get(
url=url,
params={'callback': 'myfn'},
extra_environ={'REMOTE_USER': user['name'].encode('ascii')},
status=403,
)

0 comments on commit da620a4

Please sign in to comment.