From c121a7d3d0c48d4e3abf43c06047dde3e25616c3 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Sun, 10 Mar 2013 22:52:07 +0100 Subject: OAuth: Support refresh tokens, etc Initially I was going to write a failing test for refresh tokens. Thus this fix includes an orphaned 'expect_failure' method in test utils. I ended up writing support for OAuth refresh tokens, as well as a lot of cleanup (hopefully) in the OAuth plugin code. **Rebase**: While waiting for this stuff to be merged, the testing framework changed, it comes with batteries included regarding fails. Removed legacy nosetest helper. Also added a lot of backref=backref([...], cascade='all, delete-orphan') --- mediagoblin/tests/tools.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mediagoblin/tests/tools.py') diff --git a/mediagoblin/tests/tools.py b/mediagoblin/tests/tools.py index 2e47cb5c..b68d55e8 100644 --- a/mediagoblin/tests/tools.py +++ b/mediagoblin/tests/tools.py @@ -15,6 +15,7 @@ # along with this program. If not, see . +import sys import os import pkg_resources import shutil @@ -28,7 +29,6 @@ from mediagoblin import mg_globals from mediagoblin.db.models import User, MediaEntry, Collection from mediagoblin.tools import testing from mediagoblin.init.config import read_mediagoblin_config -from mediagoblin.db.open import setup_connection_and_db_from_config from mediagoblin.db.base import Session from mediagoblin.meddleware import BaseMeddleware from mediagoblin.auth.lib import bcrypt_gen_password_hash @@ -50,9 +50,10 @@ USER_DEV_DIRECTORIES_TO_SETUP = [ 'beaker/sessions/data', 'beaker/sessions/lock'] BAD_CELERY_MESSAGE = """\ -Sorry, you *absolutely* must run nosetests with the +Sorry, you *absolutely* must run tests with the mediagoblin.init.celery.from_tests module. Like so: -$ CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests ./bin/nosetests""" +$ CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests {0}\ +""".format(sys.argv[0]) class BadCeleryEnviron(Exception): pass @@ -232,7 +233,7 @@ def fixture_media_entry(title=u"Some title", slug=None, entry.slug = slug entry.uploader = uploader or fixture_add_user().id entry.media_type = u'image' - + if gen_slug: entry.generate_slug() if save: -- cgit v1.2.3