Skip to content

Commit

Permalink
refactor get of admin_login_password
Browse files Browse the repository at this point in the history
  • Loading branch information
yvaucher committed Aug 29, 2014
1 parent 2b9967b commit c0a4032
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@ def before_scenario(ctx, scenario):
if not ctx.client.user and 'no_login' not in scenario.tags:
server = ctx.conf['server']
database = ctx.conf['db_name']
config = server.tools.config
# We try to manage default login
# even if there is a sentence to log a given user
# Just add options.admin_login_password in your buildout to log from config
admin_login_password = server.tools.config.get('admin_login_password')
if admin_login_password:
ctx.client.login('admin', admin_login_password, database=database)
else:
ctx.client.login('admin', 'admin', database=database)
# Just add options.admin_login_password in your buildout to log from
# config
admin_login_password = config.get('admin_login_password', 'admin')
ctx.client.login('admin', admin_login_password, database=database)


def before_step(ctx, step):
Expand Down

0 comments on commit c0a4032

Please sign in to comment.