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'))
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
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
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)
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='******')