Drop Django 1.11 support

Django 1.11 support was dropped. Django 1.11 ends its extended support
in April 2020 which is before Ussuri release. Considering this,
horizon dropped Django 1.11 support.

Unnecessary Django version checks in the code are also dropped.

Change-Id: I2c58934f2b026745fbc97a58212b91d149db3657
This commit is contained in:
Akihiro Motoki 2019-12-29 04:54:37 +09:00
parent c5dd1536a0
commit a2a3e8b6c3
8 changed files with 24 additions and 55 deletions

View File

@ -32,12 +32,6 @@
required-projects: required-projects:
- name: openstack/horizon - name: openstack/horizon
- job:
name: horizon-tox-python3-django111
parent: horizon-tox-python3-django
vars:
django_version: '>=1.11,<2.0'
- job: - job:
name: horizon-tox-python3-django22 name: horizon-tox-python3-django22
parent: horizon-tox-python3-django parent: horizon-tox-python3-django
@ -173,11 +167,9 @@
Run unit tests with non-primary Django versions. Run unit tests with non-primary Django versions.
check: check:
jobs: jobs:
- horizon-tox-python3-django111
- horizon-tox-python3-django22 - horizon-tox-python3-django22
gate: gate:
jobs: jobs:
- horizon-tox-python3-django111
- horizon-tox-python3-django22 - horizon-tox-python3-django22
- project: - project:

View File

@ -14,7 +14,6 @@
import mock import mock
import django
from django.core.management import call_command from django.core.management import call_command
from django.core.management import CommandError from django.core.management import CommandError
from django.test import TestCase from django.test import TestCase
@ -30,17 +29,9 @@ class CommandsTestCase(TestCase):
def test_startdash_usage_correct(self, handle): def test_startdash_usage_correct(self, handle):
call_command('startdash', 'test_dash') call_command('startdash', 'test_dash')
if django.VERSION >= (2, 2):
handle.assert_called_with( handle.assert_called_with(
dash_name='test_dash', dash_name='test_dash',
extensions=["py", "tmpl", "html", "js", "css"], extensions=["py", "tmpl", "html", "js", "css"],
files=[], force_color=False, no_color=False, pythonpath=None, files=[], force_color=False, no_color=False, pythonpath=None,
settings=None, skip_checks=True, target=None, template=None, settings=None, skip_checks=True, target=None, template=None,
traceback=False, verbosity=1) traceback=False, verbosity=1)
else:
handle.assert_called_with(
dash_name='test_dash',
extensions=["py", "tmpl", "html", "js", "css"],
files=[], no_color=False, pythonpath=None,
settings=None, skip_checks=True, target=None, template=None,
traceback=False, verbosity=1)

View File

@ -14,7 +14,6 @@
import mock import mock
import django
from django.core.management import call_command from django.core.management import call_command
from django.core.management import CommandError from django.core.management import CommandError
from django.test import TestCase from django.test import TestCase
@ -30,17 +29,9 @@ class CommandsTestCase(TestCase):
def test_startpanel_usage_correct(self, handle): def test_startpanel_usage_correct(self, handle):
call_command('startpanel', 'test_dash', '--dashboard=foo.bar') call_command('startpanel', 'test_dash', '--dashboard=foo.bar')
if django.VERSION >= (2, 2):
handle.assert_called_with( handle.assert_called_with(
panel_name='test_dash', dashboard='foo.bar', panel_name='test_dash', dashboard='foo.bar',
extensions=["py", "tmpl", "html"], extensions=["py", "tmpl", "html"],
files=[], force_color=False, no_color=False, pythonpath=None, files=[], force_color=False, no_color=False, pythonpath=None,
settings=None, skip_checks=True, target=None, settings=None, skip_checks=True, target=None,
template=None, traceback=False, verbosity=1) template=None, traceback=False, verbosity=1)
else:
handle.assert_called_with(
panel_name='test_dash', dashboard='foo.bar',
extensions=["py", "tmpl", "html"],
files=[], no_color=False, pythonpath=None,
settings=None, skip_checks=True, target=None,
template=None, traceback=False, verbosity=1)

View File

@ -18,7 +18,6 @@
import unittest import unittest
import uuid import uuid
import django
from django import forms from django import forms
from django import http from django import http
from django import shortcuts from django import shortcuts
@ -669,12 +668,8 @@ class DataTableTests(test.TestCase):
row = self.table.get_rows()[0] row = self.table.get_rows()[0]
self.assertEqual(35, len(row.cells['status'].data)) self.assertEqual(35, len(row.cells['status'].data))
if django.VERSION >= (2, 2):
self.assertEqual(u'A Status that is longer than 35 ch…', self.assertEqual(u'A Status that is longer than 35 ch…',
row.cells['status'].data) row.cells['status'].data)
else:
self.assertEqual(u'A Status that is longer than 35 ...',
row.cells['status'].data)
def test_table_rendering(self): def test_table_rendering(self):
self.table = MyTable(self.request, TEST_DATA) self.table = MyTable(self.request, TEST_DATA)

View File

@ -16,7 +16,7 @@ cryptography==2.1
debtcollector==1.2.0 debtcollector==1.2.0
decorator==3.4.0 decorator==3.4.0
deprecation==1.0 deprecation==1.0
Django==1.11 Django==2.2
django-appconf==1.0.2 django-appconf==1.0.2
django-babel==0.6.2 django-babel==0.6.2
django-compressor==2.0 django-compressor==2.0

View File

@ -4906,17 +4906,11 @@ class InstanceTests2(InstanceTestBase, InstanceTableTestMixin):
self.assertEqual(res.context['form'].errors['__all__'], self.assertEqual(res.context['form'].errors['__all__'],
["Passwords do not match."]) ["Passwords do not match."])
if django.VERSION >= (1, 9):
image_list_count = 8
ext_count = 2
else:
image_list_count = 5
ext_count = 1
self.mock_server_get.assert_called_once_with( self.mock_server_get.assert_called_once_with(
helpers.IsHttpRequest(), server.id) helpers.IsHttpRequest(), server.id)
self._check_glance_image_list_detailed(count=image_list_count) self._check_glance_image_list_detailed(count=8)
self.assert_mock_multiple_calls_with_same_arguments( self.assert_mock_multiple_calls_with_same_arguments(
self.mock_extension_supported, ext_count, self.mock_extension_supported, 2,
mock.call('DiskConfig', helpers.IsHttpRequest())) mock.call('DiskConfig', helpers.IsHttpRequest()))
self.assert_mock_multiple_calls_with_same_arguments( self.assert_mock_multiple_calls_with_same_arguments(
self.mock_is_feature_available, 2, self.mock_is_feature_available, 2,

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Django 1.11 support was dropped. Django 1.11 ends its extended support
in April 2020 which is before Ussuri release. Considering this, horizon
dropped Django 1.11 support and use Django 2.2 as default.

View File

@ -11,7 +11,7 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0
# Horizon Core Requirements # Horizon Core Requirements
Babel!=2.4.0,>=2.3.4 # BSD Babel!=2.4.0,>=2.3.4 # BSD
debtcollector>=1.2.0 # Apache-2.0 debtcollector>=1.2.0 # Apache-2.0
Django>=1.11 # BSD Django>=2.2 # BSD
django-babel>=0.6.2 # BSD django-babel>=0.6.2 # BSD
django-compressor>=2.0 # MIT django-compressor>=2.0 # MIT
django-debreach>=1.4.2 # BSD License (2 clause) django-debreach>=1.4.2 # BSD License (2 clause)