示例#1
0
文件: web.py 项目: sayonetech/love
def create_key():
    description = request.form.get('description')
    new_key = AccessKey.create(description)

    flash(
        'Your API key {} has been created. Refresh the page to see it below.'.
        format(new_key.access_key))
    return redirect(url_for('keys'))
示例#2
0
 def setUp(self):
     super(AutocompleteTest, self).setUp()
     create_employee(username='******')
     create_employee(username='******')
     create_employee(username='******')
     create_employee(username='******')
     logic.employee.rebuild_index()
     self.api_key = AccessKey.create('autocomplete key').access_key
示例#3
0
 def setUp(self):
     super(AutocompleteTest, self).setUp()
     create_employee(username='******')
     create_employee(username='******')
     create_employee(username='******')
     create_employee(username='******')
     with mock.patch('logic.employee.memory_usage', autospec=True):
         logic.employee.rebuild_index()
     self.api_key = AccessKey.create('autocomplete key').access_key
示例#4
0
 def test_with_api_key(self):
     api_key = AccessKey.create('test key').access_key
     response = self.do_request(api_key)
     self.assertEqual(response.status_int, self.successful_response_code)
示例#5
0
 def setUp(self):
     self.api_key = AccessKey.create('test key').access_key
     create_employee(username='******')
     create_alias_with_employee_username(name='bobby', username='******')
     create_employee(username='******')