summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/resources/project_handlers.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-04-05 16:23:03 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-04-06 16:55:21 +0800
commitaa823fd3bbe42ead475217e2a5b947a636cf63dd (patch)
tree68e9e80dae6bb6325de2d8a839ee9d5fe6055ca6 /utils/test/testapi/opnfv_testapi/resources/project_handlers.py
parent5412a1b30129d25b6f7f7de6c5262e2e3edc699b (diff)
unify error message in TestAPI
Change-Id: I994feb7bf340c9e48bebe9fdf3dc3a76bc254652 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/resources/project_handlers.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/resources/project_handlers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/test/testapi/opnfv_testapi/resources/project_handlers.py b/utils/test/testapi/opnfv_testapi/resources/project_handlers.py
index 087bb8af2..59e0b88e5 100644
--- a/utils/test/testapi/opnfv_testapi/resources/project_handlers.py
+++ b/utils/test/testapi/opnfv_testapi/resources/project_handlers.py
@@ -9,6 +9,7 @@
import httplib
import handlers
+from opnfv_testapi.common import message
from opnfv_testapi.tornado_swagger import swagger
import project_models
@@ -48,8 +49,7 @@ class ProjectCLHandler(GenericProjectHandler):
return {'name': data.name}
def error(data):
- message = '{} already exists as a project'.format(data.name)
- return httplib.FORBIDDEN, message
+ return httplib.FORBIDDEN, message.exist('project', data.name)
miss_checks = ['name']
db_checks = [(self.table, False, query, error)]