#
# 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
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:
# Correct place?
assert urlparse.urlsplit(res.location)[2] == '/u/chris/'
- assert 'mediagoblin/user_pages/user.html' in template.TEMPLATE_TEST_CONTEXT
+ assert 'mediagoblin/user_pages/user_nonactive.html' in template.TEMPLATE_TEST_CONTEXT
# No need to test if user is in logged in and verification email
# awaits, since openid uses the register_user function which is
def test_add_delete(self, openid_plugin_app):
"""Test adding and deleting openids"""
# Add user
- test_user = fixture_add_user(password='')
+ test_user = fixture_add_user(password='', privileges=[u'active'])
openid = OpenIDUserURL()
openid.openid_url = 'http://real.myopenid.com'
openid.user_id = test_user.id