Port admin metering tests to Python 3

Replace json with oslo_serialization

Change-Id: I065bf68b55fca28481ae760dc4e9ba3c5822c3e0
Partial-Implements: blueprint porting-python3
This commit is contained in:
lawrancejing 2015-10-15 14:32:25 +00:00
parent d8aaa41b91
commit 3e675d5ed3
2 changed files with 4 additions and 2 deletions

View File

@ -9,7 +9,6 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import json
from django.core.urlresolvers import reverse
from django import http
@ -17,6 +16,8 @@ from django import http
from mox3.mox import IsA # noqa
import six
from oslo_serialization import jsonutils
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
from openstack_dashboard.test.test_data import utils as test_utils
@ -63,7 +64,7 @@ class MeteringLineChartTabTests(test.BaseAdminViewTests):
test_utils.load_test_data(self.testdata)
def _verify_series(self, series, value, date, expected_names):
data = json.loads(series)
data = jsonutils.loads(series)
self.assertTrue('series' in data)
self.assertEqual(len(data['series']), len(expected_names))
for d in data['series']:

View File

@ -23,6 +23,7 @@ commands = /bin/bash run_tests.sh -N --no-pep8 {posargs}
commands =
python manage.py test --settings=horizon.test.settings horizon.test.tests
python manage.py test --settings=openstack_dashboard.test.settings \
openstack_dashboard.dashboards.admin.metering \
openstack_dashboard.contrib.sahara.content.data_processing.data_sources.tests \
openstack_dashboard.contrib.sahara.content.data_processing.job_binaries.tests \
openstack_dashboard.contrib.sahara.content.data_processing.jobs.tests \