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

View File

@ -14,7 +14,6 @@
import mock
import django
from django.core.management import call_command
from django.core.management import CommandError
from django.test import TestCase
@ -30,17 +29,9 @@ class CommandsTestCase(TestCase):
def test_startdash_usage_correct(self, handle):
call_command('startdash', 'test_dash')
if django.VERSION >= (2, 2):
handle.assert_called_with(
dash_name='test_dash',
extensions=["py", "tmpl", "html", "js", "css"],
files=[], force_color=False, no_color=False, pythonpath=None,
settings=None, skip_checks=True, target=None, template=None,
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)
handle.assert_called_with(
dash_name='test_dash',
extensions=["py", "tmpl", "html", "js", "css"],
files=[], force_color=False, 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 django
from django.core.management import call_command
from django.core.management import CommandError
from django.test import TestCase
@ -30,17 +29,9 @@ class CommandsTestCase(TestCase):
def test_startpanel_usage_correct(self, handle):
call_command('startpanel', 'test_dash', '--dashboard=foo.bar')
if django.VERSION >= (2, 2):
handle.assert_called_with(
panel_name='test_dash', dashboard='foo.bar',
extensions=["py", "tmpl", "html"],
files=[], force_color=False, no_color=False, pythonpath=None,
settings=None, skip_checks=True, target=None,
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)
handle.assert_called_with(
panel_name='test_dash', dashboard='foo.bar',
extensions=["py", "tmpl", "html"],
files=[], force_color=False, 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 uuid
import django
from django import forms
from django import http
from django import shortcuts
@ -669,12 +668,8 @@ class DataTableTests(test.TestCase):
row = self.table.get_rows()[0]
self.assertEqual(35, len(row.cells['status'].data))
if django.VERSION >= (2, 2):
self.assertEqual(u'A Status that is longer than 35 ch…',
row.cells['status'].data)
else:
self.assertEqual(u'A Status that is longer than 35 ...',
row.cells['status'].data)
self.assertEqual(u'A Status that is longer than 35 ch…',
row.cells['status'].data)
def test_table_rendering(self):
self.table = MyTable(self.request, TEST_DATA)

View File

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

View File

@ -4906,17 +4906,11 @@ class InstanceTests2(InstanceTestBase, InstanceTableTestMixin):
self.assertEqual(res.context['form'].errors['__all__'],
["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(
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.mock_extension_supported, ext_count,
self.mock_extension_supported, 2,
mock.call('DiskConfig', helpers.IsHttpRequest()))
self.assert_mock_multiple_calls_with_same_arguments(
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
Babel!=2.4.0,>=2.3.4 # BSD
debtcollector>=1.2.0 # Apache-2.0
Django>=1.11 # BSD
Django>=2.2 # BSD
django-babel>=0.6.2 # BSD
django-compressor>=2.0 # MIT
django-debreach>=1.4.2 # BSD License (2 clause)