def setup_module(): global app, app_murdoc config.set_profile('test') app = controllers.make_app() app = BespinTestApp(app) app_murdoc = controllers.make_app() app_murdoc = BespinTestApp(app_murdoc) _install_test_plugin_path() config.activate_profile()
def _reset(): Base.metadata.drop_all(bind=config.c.dbengine) Base.metadata.create_all(bind=config.c.dbengine) fsroot = config.c.fsroot if fsroot.exists() and fsroot.basename() == "testfiles": fsroot.rmtree() fsroot.makedirs() global session session = config.c.session_factory() num_users = session.query(User).count() assert_equals(num_users, 0) session.commit() global mattb, zuck, tom, ev, joe mattb = User.create_user("mattb", "mattb", "mattb") zuck = User.create_user("zuck", "zuck", "zuck") tom = User.create_user("tom", "tom", "tom") ev = User.create_user("ev", "ev", "ev") joe = User.create_user("joe", "joe", "joe") group = joe.add_group("group") group.add_member(mattb) group.add_member(zuck) group.add_member(tom) group.add_member(ev) global app app = controllers.make_app() app = BespinTestApp(app) app.post("/register/login/joe", dict(password="******"))
def setup_module(module): global app, session config.set_profile('test') config.activate_profile() Base.metadata.drop_all(bind=config.c.dbengine) Base.metadata.create_all(bind=config.c.dbengine) session = config.c.session_factory() User.create_user("BillBixby", "", "*****@*****.**") app = controllers.make_app() app = BespinTestApp(app) app.post("/register/login/BillBixby", dict(password=""))
def test_auth_required(): app = controllers.make_app() app = BespinTestApp(app) app.post('/settings/', {'foo' : 'bar'}, status=401) app.get('/settings/', status=401) app.get('/settings/foo', status=401)
def setup_module(module): global app config.set_profile('test') app = controllers.make_app() app = BespinTestApp(app)