Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2166 from ckan/2165-check-access-log
[#2165] Only one log message now on check_access.
- Loading branch information
Showing
7 changed files
with
84 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
''' | ||
NB Don't test logic functions here. This is just for the mechanics of the API | ||
controller itself. | ||
''' | ||
import json | ||
|
||
import ckan.new_tests.helpers as helpers | ||
|
||
|
||
class TestApiController(helpers.FunctionalTestBase): | ||
|
||
def test_unicode_in_error_message_works_ok(self): | ||
# Use tag_delete to echo back some unicode | ||
app = self._get_test_app() | ||
org_url = '/api/action/tag_delete' | ||
data_dict = {'id': u'Delta symbol: \u0394'} # unicode gets rec'd ok | ||
postparams = '%s=1' % json.dumps(data_dict) | ||
response = app.post(url=org_url, params=postparams, status=404) | ||
# The unicode is backslash encoded (because that is the default when | ||
# you do str(exception) ) | ||
assert 'Delta symbol: \\u0394' in response.body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters