Exemplo n.º 1
0
 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'
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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"
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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"