Fix UT bug in test-flavor 41/38941/1
authorYun Huang <yun.huang@windriver.com>
Tue, 27 Mar 2018 07:55:43 +0000 (15:55 +0800)
committerYun Huang <yun.huang@windriver.com>
Tue, 27 Mar 2018 07:55:43 +0000 (15:55 +0800)
Change-Id: I9e92cc4d1f3b2704dcf77b5e49f7bc13d4ba969f
Issue-ID: MULTICLOUD-203
Signed-off-by: Yun Huang <yun.huang@windriver.com>
newton/newton/requests/tests/test_flavor.py

index e0fa041..4a9df9c 100644 (file)
@@ -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()