aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-07-14 11:23:52 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-07-14 11:23:52 -0500
commitdf206ab633ef369c89d27321823daf140a5ff6f4 (patch)
tree1118bd91bfab913345cbafa7245e2509f04034f6
parent2d0028e93283fea397133294a5eb45b67d5ed0ab (diff)
downloadmediagoblin-df206ab633ef369c89d27321823daf140a5ff6f4.tar.lz
mediagoblin-df206ab633ef369c89d27321823daf140a5ff6f4.tar.xz
mediagoblin-df206ab633ef369c89d27321823daf140a5ff6f4.zip
Skip the openid tests if the openid module is not installed.
This commit sponsored by Brandon Smith. Thank you!
-rw-r--r--mediagoblin/tests/test_openid.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mediagoblin/tests/test_openid.py b/mediagoblin/tests/test_openid.py
index bba46db8..23a2290e 100644
--- a/mediagoblin/tests/test_openid.py
+++ b/mediagoblin/tests/test_openid.py
@@ -13,12 +13,14 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
import urlparse
import pkg_resources
import pytest
import mock
-from openid.consumer.consumer import SuccessResponse
+openid_consumer = pytest.importorskip(
+ "openid.consumer.consumer")
from mediagoblin import mg_globals
from mediagoblin.db.base import Session
@@ -27,7 +29,6 @@ from mediagoblin.plugins.openid.models import OpenIDUserURL
from mediagoblin.tests.tools import get_app, fixture_add_user
from mediagoblin.tools import template
-
# App with plugin enabled
@pytest.fixture()
def openid_plugin_app(request):
@@ -41,7 +42,7 @@ def openid_plugin_app(request):
class TestOpenIDPlugin(object):
def _setup(self, openid_plugin_app, value=True, edit=False, delete=False):
if value:
- response = SuccessResponse(mock.Mock(), mock.Mock())
+ response = openid_consumer.SuccessResponse(mock.Mock(), mock.Mock())
if edit or delete:
response.identity_url = u'http://add.myopenid.com'
else: