From eb6fdec80434f3fcf35641a7014a8801fadcdf4e Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 28 May 2016 00:17:02 +0200 Subject: [PATCH] Add support for django CMS 3.3 --- HISTORY.rst | 5 +++++ djangocms_installer/config/__init__.py | 11 +++++++---- djangocms_installer/config/data.py | 15 ++++++++------ tests/config.py | 27 ++++++++++++++++++++++---- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index b1c2ebb..2351e49 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,11 @@ History ------- +0.8.10 (2016-05-28) ++++++++++++++++++++ + +* Add support for django CMS 3.3 final + 0.8.9 (2016-05-19) ++++++++++++++++++ diff --git a/djangocms_installer/config/__init__.py b/djangocms_installer/config/__init__.py index a275e2c..86eda29 100644 --- a/djangocms_installer/config/__init__.py +++ b/djangocms_installer/config/__init__.py @@ -258,6 +258,8 @@ def parse(args): requirements.extend(data.REQUIREMENTS['cms-3.0']) elif cms_version >= 3.2: requirements.extend(data.REQUIREMENTS['cms-3.2']) + elif cms_version >= 3.3: + requirements.extend(data.REQUIREMENTS['cms-3.3']) elif cms_version == 3.1: requirements.extend(data.REQUIREMENTS['cms-3.1']) else: @@ -283,14 +285,15 @@ def parse(args): else: requirements.extend(data.REQUIREMENTS['plugins-common-master']) requirements.extend(data.REQUIREMENTS['plugins-basic-master']) - if cms_version == 3: - requirements.extend(data.REQUIREMENTS['ckeditor-3.0']) - elif cms_version >= 3.3 or cms_version == 'rc': + if cms_version >= 3.3: requirements.extend(data.REQUIREMENTS['ckeditor-3.3']) - elif cms_version >= 3.2: + elif cms_version == 3.2: requirements.extend(data.REQUIREMENTS['ckeditor-3.2']) elif cms_version == 3.1: requirements.extend(data.REQUIREMENTS['ckeditor-3.1']) + if cms_version == 3: + requirements.extend(data.REQUIREMENTS['ckeditor-3.0']) + if args.aldryn: # pragma: no cover requirements.extend(data.REQUIREMENTS['aldryn']) diff --git a/djangocms_installer/config/data.py b/djangocms_installer/config/data.py index 48b0826..f0800eb 100644 --- a/djangocms_installer/config/data.py +++ b/djangocms_installer/config/data.py @@ -16,13 +16,13 @@ DJANGOCMS_BETA = 'https://github.com/divio/django-cms/archive/3.0.0.beta3.zip' if sys.version_info < (2, 7): - DJANGOCMS_SUPPORTED = ('2.4', '3.0', '3.1', '3.2', 'stable', 'develop') + DJANGOCMS_SUPPORTED = ('2.4', '3.0', '3.1', '3.2', '3.3', 'stable', 'develop') DJANGOCMS_STABLE = 3.2 elif sys.version_info >= (3, 5): - DJANGOCMS_SUPPORTED = ('3.0', '3.1', '3.2', 'stable', 'rc', 'develop') + DJANGOCMS_SUPPORTED = ('3.0', '3.1', '3.2', '3.3', 'stable', 'rc', 'develop') DJANGOCMS_STABLE = 3.2 else: - DJANGOCMS_SUPPORTED = ('2.4', '3.0', '3.1', '3.2', 'stable', 'rc', 'develop') + DJANGOCMS_SUPPORTED = ('2.4', '3.0', '3.1', '3.2', '3.3', 'stable', 'rc', 'develop') DJANGOCMS_STABLE = 3.2 DJANGO_DEVELOP = 'https://github.com/django/django/archive/master.zip?%s' % time.time() @@ -116,7 +116,10 @@ 'django-treebeard>=2.0', ], 'cms-3.2': [ - 'django-treebeard>=2.0', + 'django-treebeard>=4.0', + ], + 'cms-3.3': [ + 'django-treebeard>=4.0', ], 'ckeditor-3.0': [ 'djangocms-admin-style<0.3', @@ -128,11 +131,11 @@ ], 'ckeditor-3.2': [ 'djangocms-admin-style>=1.0.6', - 'djangocms-text-ckeditor>=2.8.1', + 'djangocms-text-ckeditor>=2.8.1,<3.0', ], 'ckeditor-3.3': [ 'djangocms-admin-style>=1.1.1', - 'https://github.com/divio/djangocms-text-ckeditor/archive/develop.zip' + 'djangocms-text-ckeditor>=3.0', ], 'plugins-common': [ 'djangocms-column', diff --git a/tests/config.py b/tests/config.py index 14020ff..74a8201 100644 --- a/tests/config.py +++ b/tests/config.py @@ -516,7 +516,26 @@ def test_requirements(self): self.assertTrue(conf_data.requirements.find(config.data.DJANGOCMS_DEVELOP) > -1) self.assertTrue(conf_data.requirements.find('Django<1.9') > -1) self.assertTrue(conf_data.requirements.find('django-reversion>=1.8.7') > -1) - self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor/archive/develop') > -1) + self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.0') > -1) + self.assertTrue(conf_data.requirements.find('djangocms-admin-style') > -1) + self.assertTrue(conf_data.requirements.find('pytz') > -1) + + conf_data = config.parse([ + '-q', + '--db=postgres://user:pwd@host/dbname', + '--i18n=no', + '--cms-version=3.3', + '--django-version=stable', + '-f', + '--reversion=yes', + '-z=yes', + '-p'+self.project_dir, + 'example_prj']) + + self.assertTrue(conf_data.requirements.find('django-cms<3.4') > -1) + self.assertTrue(conf_data.requirements.find('Django<1.9') > -1) + self.assertTrue(conf_data.requirements.find('django-reversion>=1.8.7') > -1) + self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.0') > -1) self.assertTrue(conf_data.requirements.find('djangocms-admin-style') > -1) self.assertTrue(conf_data.requirements.find('pytz') > -1) @@ -539,14 +558,14 @@ def test_requirements(self): if sys.version_info < (2, 7): self.assertTrue(conf_data.requirements.find('Django<1.7') > -1) self.assertTrue(conf_data.requirements.find('django-reversion>=1.8,<1.9') > -1) - self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor/archive/develop') > -1) + self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.0') > -1) self.assertTrue(conf_data.requirements.find('djangocms-admin-style>=1.1.1') > -1) self.assertTrue(conf_data.requirements.find('djangocms-teaser') > -1) self.assertTrue(conf_data.requirements.find('south') > -1) else: self.assertTrue(conf_data.requirements.find('Django<1.9') > -1) self.assertTrue(conf_data.requirements.find('django-reversion>=1.8.7') > -1) - self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor/archive/develop') > -1) + self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.0') > -1) self.assertTrue(conf_data.requirements.find('djangocms-admin-style>=1.1.1') > -1) self.assertTrue(conf_data.requirements.find('djangocms-teaser/archive/master.zip') > -1) self.assertTrue(conf_data.requirements.find('south') == -1) @@ -579,7 +598,7 @@ def test_requirements(self): self.assertTrue(conf_data.requirements.find('Django<1.9') > -1) self.assertTrue(conf_data.requirements.find('django-reversion>=1.8.7') > -1) self.assertTrue(conf_data.requirements.find('django-mptt<0.9') > -1) - self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor/archive/master.zip') == -1) + self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.0') == -1) self.assertTrue(conf_data.requirements.find('djangocms-admin-style/archive/master.zip') == -1) self.assertTrue(conf_data.requirements.find('djangocms-teaser/archive/master.zip') == -1) self.assertTrue(conf_data.requirements.find('south') == -1)