From fa556ed92ed8952f9a966677f031d2573ab16a49 Mon Sep 17 00:00:00 2001 From: Yun Huang Date: Tue, 27 Mar 2018 15:55:43 +0800 Subject: Fix UT bug in test-flavor Change-Id: I9e92cc4d1f3b2704dcf77b5e49f7bc13d4ba969f Issue-ID: MULTICLOUD-203 Signed-off-by: Yun Huang --- newton/newton/requests/tests/test_flavor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/newton/newton/requests/tests/test_flavor.py b/newton/newton/requests/tests/test_flavor.py index e0fa041a..4a9df9c5 100644 --- a/newton/newton/requests/tests/test_flavor.py +++ b/newton/newton/requests/tests/test_flavor.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import json import mock import unittest @@ -184,7 +185,8 @@ class TestFlavorsNewton(unittest.TestCase, AbstractTestResource): ("/api/%s/v0/windriver-hudson-dc_RegionOne" "/fcca3cc49d5e42caae15459e27103efc/" "flavors" % test_base.MULTIVIM_VERSION), - self.MOCK_POST_RESOURCE_REQUEST, + data=json.dumps(self.MOCK_POST_RESOURCE_REQUEST), + content_type='application/json', HTTP_X_AUTH_TOKEN=mock_info.MOCK_TOKEN_ID) context = response.json() @@ -220,7 +222,8 @@ class TestFlavorsNewton(unittest.TestCase, AbstractTestResource): ("/api/%s/v0/windriver-hudson-dc_RegionOne/" "fcca3cc49d5e42caae15459e27103efc/" "flavors" % test_base.MULTIVIM_VERSION), - self.MOCK_POST_RESOURCE_REQUEST_EXISTING, + data=json.dumps(self.MOCK_POST_RESOURCE_REQUEST_EXISTING), + content_type='application/json', HTTP_X_AUTH_TOKEN=mock_info.MOCK_TOKEN_ID) context = response.json() -- cgit 1.2.3-korg