Created
July 17, 2013 23:57
-
-
Save rclark/6025637 to your computer and use it in GitHub Desktop.
Little action testing example
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
from ckanext.ngds.tests.ngds_test_case import NgdsTestCase | |
class MyActionTestCase(NgdsTestCase): | |
def test_gobbledee_action(self): | |
# Generate your POST body | |
post_body = { | |
"turkeys": 12, | |
"gobbles": ["gobble", "gobble"] | |
} | |
# Call the action | |
action_name = "what_do_we_do_with_turkey" | |
result = self.call_action(action_name, post_body) | |
# Make some assertions to see that things went well | |
self.assertIsNotNone(result) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment