Skip to content

Instantly share code, notes, and snippets.

@paulgoetze
Last active May 30, 2017 16:46
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 paulgoetze/dd7c17d6943bf828a10e8a9b165d07c0 to your computer and use it in GitHub Desktop.
Save paulgoetze/dd7c17d6943bf828a10e8a9b165d07c0 to your computer and use it in GitHub Desktop.
Testing Your Python API App with JSON Schema - tests/test_users.py
# tests/test_users.py
import json
from .support.assertions import assert_valid_schema
def test_get_user(client):
# Do whatever is necessary to create a user here…
response = client.get('/users/1')
json_data = json.loads(response.data)
assert_valid_schema(json_data, 'user.json')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment