From 104fc9350343229ada93effb560eb5259d1e1307 Mon Sep 17 00:00:00 2001 From: Ken Tsang Date: Thu, 10 Aug 2017 18:03:20 +0100 Subject: [PATCH] Refactor code --- app/inbound_number/rest.py | 6 +++--- tests/app/conftest.py | 9 --------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/inbound_number/rest.py b/app/inbound_number/rest.py index b13bed3b1..7d87f68b4 100644 --- a/app/inbound_number/rest.py +++ b/app/inbound_number/rest.py @@ -5,7 +5,7 @@ from app.dao.inbound_numbers_dao import ( dao_get_inbound_number_for_service, dao_get_available_inbound_numbers, dao_set_inbound_number_to_service, - dao_set_inbound_number_active_flag_for_service + dao_set_inbound_number_active_flag ) from app.errors import register_errors from app.models import InboundNumber @@ -35,11 +35,11 @@ def post_allocate_or_reactivate_inbound_number(service_id): else: return '', 409 else: - dao_set_inbound_number_active_flag_for_service(service_id, active=True) + dao_set_inbound_number_active_flag(service_id, active=True) return '', 204 @inbound_number_blueprint.route('//off', methods=['POST']) def post_deactivate_inbound_number(service_id): - dao_set_inbound_number_active_flag_for_service(service_id, active=False) + dao_set_inbound_number_active_flag(service_id, active=False) return '', 204 diff --git a/tests/app/conftest.py b/tests/app/conftest.py index 5227b5e5c..5b38fa739 100644 --- a/tests/app/conftest.py +++ b/tests/app/conftest.py @@ -1051,20 +1051,11 @@ def admin_request(client): data=json.dumps(_data), headers=[('Content-Type', 'application/json'), create_authorization_header()] ) -<<<<<<< HEAD -<<<<<<< HEAD - json_resp = json.loads(resp.get_data(as_text=True)) - assert resp.status_code == _expected_status, json_resp -======= - if resp.get_data: -======= if resp.get_data(): ->>>>>>> Fixed admin_request bug json_resp = json.loads(resp.get_data(as_text=True)) else: json_resp = None assert resp.status_code == _expected_status ->>>>>>> Refactor conftest return json_resp @staticmethod