modified test .ini files and changed tests to use basic_auth bcrypt

This commit is contained in:
Rodney Ewing 2013-05-15 15:56:05 -07:00
parent f65615eaf9
commit fa7232913c
5 changed files with 11 additions and 3 deletions

View File

@ -2,6 +2,7 @@
direct_remote_path = /test_static/
email_sender_address = "notice@mediagoblin.example.org"
email_debug_mode = true
no_auth = true
# TODO: Switch to using an in-memory database
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"

View File

@ -12,6 +12,10 @@ email_debug_mode = true
# Set to false to disable registrations
allow_registration = true
# Set to true to run an instance with no authentication plugins enabled.
# You will not be able to login or register
no_auth = true
[plugins]
[[mediagoblin.tests.testplugins.pluginspec]]
some_string = "not blork"

View File

@ -21,7 +21,8 @@ from mediagoblin import mg_globals
from mediagoblin.db.models import User
from mediagoblin.tests.tools import fixture_add_user
from mediagoblin.tools import template
from mediagoblin.auth.lib import bcrypt_check_password
from mediagoblin.plugins.basic_auth.lib import bcrypt_check_password
class TestUserEdit(object):
def setup(self):

View File

@ -2,6 +2,7 @@
direct_remote_path = /test_static/
email_sender_address = "notice@mediagoblin.example.org"
email_debug_mode = true
no_auth = true
# TODO: Switch to using an in-memory database
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"
@ -31,3 +32,4 @@ BROKER_HOST = "sqlite:///%(here)s/user_dev/kombu.db"
[[mediagoblin.plugins.oauth]]
[[mediagoblin.plugins.httpapiauth]]
[[mediagoblin.plugins.piwigo]]
[[mediagoblin.plugins.basic_auth]]

View File

@ -31,7 +31,7 @@ from mediagoblin.tools import testing
from mediagoblin.init.config import read_mediagoblin_config
from mediagoblin.db.base import Session
from mediagoblin.meddleware import BaseMeddleware
from mediagoblin.auth.lib import bcrypt_gen_password_hash
from mediagoblin.auth import gen_password_hash
from mediagoblin.gmg_commands.dbupdate import run_dbupdate
@ -179,7 +179,7 @@ def fixture_add_user(username=u'chris', password=u'toast',
test_user.username = username
test_user.email = username + u'@example.com'
if password is not None:
test_user.pw_hash = bcrypt_gen_password_hash(password)
test_user.pw_hash = gen_password_hash(password)
if active_user:
test_user.email_verified = True
test_user.status = u'active'