horizon/openstack_dashboard/test/api_tests/config_rest_tests.py
Victor Stinner bc5d12f3d0 Port config_rest_tests to Python 3
* ConfigRestTestCase: remove assertContains and assertNotContains
  methods, reuse assertIn and assertNotIn instead.
* Fix also the HTTP body type is byte string.
* tox.ini: add config_rest_tests to Python 3.4

Partial-Implements: blueprint porting-python3
Change-Id: I8cd28b4ed13ea07d77ff4c33d37162d8bf89a3a6
2015-09-01 18:35:44 +02:00

27 lines
1.1 KiB
Python

# Copyright 2015 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from openstack_dashboard.api.rest import config
from openstack_dashboard.test import helpers as test
class ConfigRestTestCase(test.TestCase):
def test_settings_config_get(self):
request = self.mock_rest_request()
response = config.Settings().get(request)
self.assertStatusCode(response, 200)
self.assertIn(b"REST_API_SETTING_1", response.content)
self.assertIn(b"REST_API_SETTING_2", response.content)
self.assertNotIn(b"REST_API_SECURITY", response.content)