def setUp(self): os.environ['PY4WEB_APPS_FOLDER'] = 'apps' self.db = DAL('sqlite:memory') self.session = Session(secret="a", expiration=10) self.session.local.data = {} self.auth = Auth(self.session, self.db, define_tables=True) self.auth.enable() request.app_name = '_scaffold'
def test_extra_fields(self): db = DAL("sqlite:memory") self.auth = Auth(self.session, db, define_tables=True, extra_fields=[Field('favorite_color')]) self.on_request() self.assertEqual(type(db.auth_user.favorite_color), Field)
def setUp(self): os.environ["PY4WEB_APPS_FOLDER"] = "apps" self.db = DAL("sqlite:memory") self.session = Session(secret="a", expiration=10) self.session.local.data = {} self.auth = Auth(self.session, self.db, define_tables=True, password_complexity=None) self.auth.enable() request.app_name = "_scaffold"
def test_extra_fields(self): self.db = DAL("sqlite:memory") self.session = Session(secret="a", expiration=10) self.session.local.data = {} self.auth = Auth(self.session, self.db, define_tables=True, extra_fields=[Field('favorite_color')]) self.assertEqual(type(self.db.auth_user.favorite_color), Field)
def setUp(self): os.environ["PY4WEB_APPS_FOLDER"] = "apps" _before_request() # mimic before_request bottle-hook self.db = DAL("sqlite:memory") self.session = Session(secret="a", expiration=10) self.session.initialize() self.auth = Auth(self.session, self.db, define_tables=True, password_complexity=None) self.auth.enable() self.auth.action = self.action request.app_name = "_scaffold"