modified test .ini files and changed tests to use basic_auth bcrypt
This commit is contained in:
parent
f65615eaf9
commit
fa7232913c
@ -2,6 +2,7 @@
|
|||||||
direct_remote_path = /test_static/
|
direct_remote_path = /test_static/
|
||||||
email_sender_address = "notice@mediagoblin.example.org"
|
email_sender_address = "notice@mediagoblin.example.org"
|
||||||
email_debug_mode = true
|
email_debug_mode = true
|
||||||
|
no_auth = true
|
||||||
|
|
||||||
# TODO: Switch to using an in-memory database
|
# TODO: Switch to using an in-memory database
|
||||||
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"
|
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"
|
||||||
|
@ -12,6 +12,10 @@ email_debug_mode = true
|
|||||||
# Set to false to disable registrations
|
# Set to false to disable registrations
|
||||||
allow_registration = true
|
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]
|
[plugins]
|
||||||
[[mediagoblin.tests.testplugins.pluginspec]]
|
[[mediagoblin.tests.testplugins.pluginspec]]
|
||||||
some_string = "not blork"
|
some_string = "not blork"
|
||||||
|
@ -21,7 +21,8 @@ from mediagoblin import mg_globals
|
|||||||
from mediagoblin.db.models import User
|
from mediagoblin.db.models import User
|
||||||
from mediagoblin.tests.tools import fixture_add_user
|
from mediagoblin.tests.tools import fixture_add_user
|
||||||
from mediagoblin.tools import template
|
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):
|
class TestUserEdit(object):
|
||||||
def setup(self):
|
def setup(self):
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
direct_remote_path = /test_static/
|
direct_remote_path = /test_static/
|
||||||
email_sender_address = "notice@mediagoblin.example.org"
|
email_sender_address = "notice@mediagoblin.example.org"
|
||||||
email_debug_mode = true
|
email_debug_mode = true
|
||||||
|
no_auth = true
|
||||||
|
|
||||||
# TODO: Switch to using an in-memory database
|
# TODO: Switch to using an in-memory database
|
||||||
sql_engine = "sqlite:///%(here)s/user_dev/mediagoblin.db"
|
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.oauth]]
|
||||||
[[mediagoblin.plugins.httpapiauth]]
|
[[mediagoblin.plugins.httpapiauth]]
|
||||||
[[mediagoblin.plugins.piwigo]]
|
[[mediagoblin.plugins.piwigo]]
|
||||||
|
[[mediagoblin.plugins.basic_auth]]
|
||||||
|
@ -31,7 +31,7 @@ from mediagoblin.tools import testing
|
|||||||
from mediagoblin.init.config import read_mediagoblin_config
|
from mediagoblin.init.config import read_mediagoblin_config
|
||||||
from mediagoblin.db.base import Session
|
from mediagoblin.db.base import Session
|
||||||
from mediagoblin.meddleware import BaseMeddleware
|
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
|
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.username = username
|
||||||
test_user.email = username + u'@example.com'
|
test_user.email = username + u'@example.com'
|
||||||
if password is not None:
|
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:
|
if active_user:
|
||||||
test_user.email_verified = True
|
test_user.email_verified = True
|
||||||
test_user.status = u'active'
|
test_user.status = u'active'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user