Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def setUp(self):
super(TestLogin, self).setUp()
login.auth_manager = self.DummyAuthenticator()
api = falcon.API(middleware=[
ReqBodyMiddleware(),
])
api.req_options.auto_parse_form_urlencoded = False
self.api = api
self.api.add_route('/login', login)
self.api.add_route('/logout', logout)
self.api.add_route('/dummy/{user}', self.UserDummy())
self.api.add_route('/dummy2/{team}', self.TeamDummy())
self.api = SessionMiddleware(self.api, self.session_opts)
self.user_name = 'test_login_user'
self.admin_name = 'test_login_admin'
self.team_name = 'test_login_team'
connection = db.connect()
def setUp(self):
super(TestLogin, self).setUp()
login.auth_manager = self.DummyAuthenticator()
api = falcon.API(middleware=[
ReqBodyMiddleware(),
])
api.req_options.auto_parse_form_urlencoded = False
self.api = api
self.api.add_route('/login', login)
self.api.add_route('/logout', logout)
self.api.add_route('/dummy/{user}', self.UserDummy())
self.api.add_route('/dummy2/{team}', self.TeamDummy())
self.api = SessionMiddleware(self.api, self.session_opts)
self.user_name = 'test_login_user'
self.admin_name = 'test_login_admin'
self.team_name = 'test_login_team'
connection = db.connect()
cursor = connection.cursor()
# Create users
cursor.execute("INSERT INTO `user` (`name`, `active`) VALUES (%s, 1)", self.user_name)
self.user_id = cursor.lastrowid
cursor.execute("INSERT INTO `user` (`name`, `active`) VALUES (%s, 1)", self.admin_name)
self.admin_id = cursor.lastrowid