diff --git a/.travis.yml b/.travis.yml index 61c1d2b..5e1b83a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,4 +43,4 @@ notifications: email: - christoph.heer@googlemail.com - jonathan.como@gmail.com -version: ~> 1.0 +version: ~> 1.0 \ No newline at end of file diff --git a/flask_testing/utils.py b/flask_testing/utils.py index 4a24e69..a28a823 100644 --- a/flask_testing/utils.py +++ b/flask_testing/utils.py @@ -35,7 +35,7 @@ from werkzeug.utils import cached_property # Use Flask's preferred JSON module so that our runtime behavior matches. -from flask import json_available, templating, template_rendered +from flask import templating, template_rendered try: from flask import message_flashed @@ -45,8 +45,13 @@ message_flashed = None _is_message_flashed = False -if json_available: +json_available = True + +try: from flask import json +except ImportError: + json_available = False + # we'll use signals for template-related tests if # available in this version of Flask