Skip to content

Instantly share code, notes, and snippets.

@rclark
Created July 17, 2013 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rclark/6025637 to your computer and use it in GitHub Desktop.
Save rclark/6025637 to your computer and use it in GitHub Desktop.
Little action testing example
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