Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1258] add validator decorator to user_activity_list
* Add decorator that validates against a given schema * Add default_activity_list_schema * Refactor user_activity list to use validator decorator
- Loading branch information
Showing
4 changed files
with
44 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import nose.tools | ||
import nose.case | ||
import ckan.logic as logic | ||
import ckan.new_tests.helpers as helpers | ||
import ckan.new_tests.factories as factories | ||
|
||
class TestBadLimitQueryParameters(object): | ||
'''test class for #1258 non-int query parameters cause 500 errors''' | ||
@classmethod | ||
def setup_class(cls): | ||
helpers.reset_db() | ||
|
||
def teardown(self): | ||
import ckan.model as model | ||
model.repo.rebuild_db() | ||
|
||
def test_user_activity_list(self): | ||
user = factories.User() | ||
nose.tools.assert_raises(logic.ValidationError, helpers.call_action, | ||
'user_activity_list', id=user['name'], limit='not_an_int', | ||
offset='not_an_int' | ||
) |