# HG changeset patch # User Daniele Nicolodi # Date 1309187687 -7200 # Node ID eaa352730e44534130a57a7073fbb8067bf19d82 # Parent 04b93e15bb7102136c7380a6c4501c5f1a546cf2 Adjust test setup code to changes to the admin interface. diff -r 04b93e15bb71 -r eaa352730e44 src/ltpdarepo/admin.py --- a/src/ltpdarepo/admin.py Mon Jun 27 16:16:07 2011 +0200 +++ b/src/ltpdarepo/admin.py Mon Jun 27 17:14:47 2011 +0200 @@ -83,12 +83,12 @@ cmd = commands.add(upgrade) cmd.add_argument('--from', type=float, dest='fromrev', metavar='REV') -def useradd(username, **kwargs): +def useradd(username, password=None, **kwargs): with interact(app): user = User.load(username) if user is not None: raise Exception('User already present') - user = User(username, **kwargs) + user = User(username, password=password, **kwargs) user.create() cmd = commands.add(useradd) diff -r 04b93e15bb71 -r eaa352730e44 src/ltpdarepo/tests/__init__.py --- a/src/ltpdarepo/tests/__init__.py Mon Jun 27 16:16:07 2011 +0200 +++ b/src/ltpdarepo/tests/__init__.py Mon Jun 27 17:14:47 2011 +0200 @@ -21,13 +21,13 @@ def doctestSetUp(self): - from ltpdarepo.admin import wipe, install, upgrade, adduser, admin, create_database + from ltpdarepo.admin import wipe, install, upgrade, useradd, grant, createdb wipe() install() upgrade() - adduser('u1', 'u1') - admin('u1') - create_database('db1') + useradd('u1', 'u1') + grant('u1', '%', ['admin', ]) + createdb('db1') def doctestTearDown(self): diff -r 04b93e15bb71 -r eaa352730e44 src/ltpdarepo/tests/test_users.py --- a/src/ltpdarepo/tests/test_users.py Mon Jun 27 16:16:07 2011 +0200 +++ b/src/ltpdarepo/tests/test_users.py Mon Jun 27 17:14:47 2011 +0200 @@ -34,11 +34,11 @@ class DatabaseTestCase(unittest.TestCase): def setUp(self): - from ltpdarepo.admin import wipe, install, upgrade, adduser + from ltpdarepo.admin import wipe, install, upgrade, useradd wipe() install() upgrade() - adduser('u1', 'u1') + useradd('u1', 'u1') from ltpdarepo import app self.app = app