Skip the openid tests if the openid module is not installed.

This commit sponsored by Brandon Smith.  Thank you!
This commit is contained in:
Christopher Allan Webber 2013-07-14 11:23:52 -05:00
parent 2d0028e932
commit df206ab633

View File

@ -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: