'Test the creation of an username.'

def test_create_username(self):

    request_json = {'devicetype': 'my_device'}
    result = requests.post(BRIDGE_URL_BASE.format('/api'), data=json.dumps(request_json), timeout=5)
    self.assertEqual(result.status_code, 200)
    self.assertTrue(('application/json' in result.headers['content-type']))
    resp_json = result.json()
    success_json = resp_json[0]
    self.assertTrue(('success' in success_json))
    self.assertTrue(('username' in success_json['success']))
