Skip to content

Commit

Permalink
Enable CMS 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Sep 15, 2016
1 parent 4d8b249 commit 06d8c59
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 48 deletions.
28 changes: 17 additions & 11 deletions djangocms_installer/config/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
'--permissions', '--bootstrap', '--templates',
'--starting-page']

DJANGOCMS_DEVELOP = 'https://github.com/divio/django-cms/archive/develop.zip?{bust}'.format(**bust)
DJANGOCMS_RC = 'https://github.com/divio/django-cms/archive/develop.zip?{bust}'.format(**bust)
DJANGOCMS_DEVELOP = 'https://github.com/divio/django-cms/archive/develop.zip?{bust}'.format(
**bust
)
DJANGOCMS_RC = 'https://github.com/divio/django-cms/archive/release/3.4.x.zip?{bust}'.format(
**bust
)
DJANGOCMS_BETA = 'https://github.com/divio/django-cms/archive/3.0.0.beta3.zip'

if sys.version_info >= (3, 5):
DJANGOCMS_SUPPORTED = ('3.2', '3.3', 'stable', 'rc', 'develop')
DJANGOCMS_STABLE = 3.3
DJANGOCMS_SUPPORTED = ('3.2', '3.3', '3.4', 'stable', 'develop')
DJANGOCMS_STABLE = 3.4
else:
DJANGOCMS_SUPPORTED = ('3.2', '3.3', 'stable', 'rc', 'develop')
DJANGOCMS_STABLE = 3.3
DJANGOCMS_SUPPORTED = ('3.2', '3.3', '3.4', 'stable', 'develop')
DJANGOCMS_STABLE = 3.4

DJANGO_DEVELOP = 'https://github.com/django/django/archive/master.zip?{bust}'.format(**bust)
DJANGO_BETA = 'https://github.com/django/django/archive/master.zip?{bust}'.format(**bust)
Expand All @@ -39,9 +43,9 @@

CMS_VERSION_MATRIX = {
'stable': DJANGOCMS_STABLE,
'rc': 3.4,
'beta': 3.4,
'develop': 3.4
'rc': 3.5,
'beta': 3.5,
'develop': 3.5
}
DJANGO_VERSION_MATRIX = {
'stable': DJANGO_STABLE,
Expand All @@ -52,7 +56,8 @@
VERSION_MATRIX = {
3.2: (1.8, 1.9),
3.3: (1.8, 1.9),
3.4: (1.8, 1.9),
3.4: (1.8, 1.9, 1.10),
3.5: (1.8, 1.9, 1.10),
}

REQUIREMENTS = {
Expand All @@ -61,6 +66,7 @@
'html5lib>=0.999999,<0.99999999',
'Pillow>=3.0',
'django-sekizai>=0.9',
'django-select2<5.0'
'six',
],
'django-1.8': [
Expand Down Expand Up @@ -96,7 +102,7 @@
'djangocms-googlemap>=0.5,<1.0',
'djangocms-snippet>=1.9,<2.0',
'djangocms-video>=1.1,<2.0',
'djangocms-column>=1.6,<2.0',
'djangocms-column>=1.6,<1.7',
],
'plugins-3.3': [
'djangocms-text-ckeditor>=3.2.1',
Expand Down
49 changes: 34 additions & 15 deletions tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_default_config(self):

self.assertEqual(conf_data.project_name, 'example_prj')

self.assertEqual(conf_data.cms_version, 3.3)
self.assertEqual(conf_data.cms_version, 3.4)
self.assertEqual(conf_data.django_version, 1.8)
self.assertEqual(conf_data.i18n, 'yes')
self.assertEqual(conf_data.reversion, 'yes')
Expand Down Expand Up @@ -58,7 +58,7 @@ def test_cli_config(self):

self.assertEqual(conf_data.project_name, 'example_prj')

self.assertEqual(conf_data.cms_version, 3.3)
self.assertEqual(conf_data.cms_version, 3.4)
self.assertEqual(conf_data.django_version, 1.8)
self.assertEqual(conf_data.i18n, 'yes')
self.assertEqual(conf_data.reversion, 'no')
Expand Down Expand Up @@ -294,22 +294,22 @@ def test_latest_version(self):
self.assertEqual(less_than_version('3.0.1'), '3.1.1')

def test_supported_versions(self):
self.assertEqual(supported_versions('stable', 'stable'), (1.8, 3.3))
self.assertEqual(supported_versions('stable', 'stable'), (1.8, 3.4))
self.assertEqual(supported_versions('stable', '3.1.10'), (1.8, None))
self.assertEqual(supported_versions('stable', 'rc'), (1.8, 3.4))
self.assertEqual(supported_versions('stable', 'beta'), (1.8, 3.4))
self.assertEqual(supported_versions('stable', 'develop'), (1.8, 3.4))
self.assertEqual(supported_versions('stable', 'rc'), (1.8, 3.5))
self.assertEqual(supported_versions('stable', 'beta'), (1.8, 3.5))
self.assertEqual(supported_versions('stable', 'develop'), (1.8, 3.5))

with self.assertRaises(RuntimeError):
supported_versions('stable', '2.4'), (1.5, 2.4)
with self.assertRaises(RuntimeError):
supported_versions('1.5', 'stable'), (1.8, 3.1)

self.assertEqual(supported_versions('1.9', 'stable'), (1.9, 3.3))
self.assertEqual(supported_versions('1.8', 'stable'), (1.8, 3.3))
self.assertEqual(supported_versions('1.8.3', 'stable'), (None, 3.3))
self.assertEqual(supported_versions('beta', 'stable'), (1.9, 3.3))
self.assertEqual(supported_versions('develop', 'stable'), (1.9, 3.3))
self.assertEqual(supported_versions('1.9', 'stable'), (1.9, 3.4))
self.assertEqual(supported_versions('1.8', 'stable'), (1.8, 3.4))
self.assertEqual(supported_versions('1.8.3', 'stable'), (None, 3.4))
self.assertEqual(supported_versions('beta', 'stable'), (1.9, 3.4))
self.assertEqual(supported_versions('develop', 'stable'), (1.9, 3.4))

def test_requirements(self):
"""
Expand Down Expand Up @@ -345,9 +345,9 @@ def test_requirements(self):
'-p'+self.project_dir,
'example_prj'])

self.assertTrue(conf_data.requirements.find('django-cms<3.4') > -1)
self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
self.assertTrue(conf_data.requirements.find('django-reversion>=1.10,<1.11') > -1)
self.assertFalse(conf_data.requirements.find('django-reversion') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.2.1') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-admin-style>=1.2') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-column') > -1)
Expand Down Expand Up @@ -412,7 +412,7 @@ def test_requirements(self):
'-q',
'--db=postgres://user:pwd@host/dbname',
'--i18n=no',
'--cms-version=rc',
'--cms-version=develop',
'--django-version=stable',
'-f',
'--reversion=yes',
Expand All @@ -434,6 +434,25 @@ def test_requirements(self):

self.assertTrue(conf_data.requirements.find('pytz') > -1)

conf_data = config.parse([
'-q',
'--db=postgres://user:pwd@host/dbname',
'--i18n=no',
'--cms-version=3.4',
'--django-version=stable',
'-f',
'--reversion=yes',
'-z=yes',
'-p'+self.project_dir,
'example_prj'])

self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
self.assertFalse(conf_data.requirements.find('django-reversion') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.2') > -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',
Expand All @@ -448,7 +467,7 @@ def test_requirements(self):

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.10,<1.11') > -1)
self.assertTrue(conf_data.requirements.find('django-reversion') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.2') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-admin-style') > -1)
self.assertTrue(conf_data.requirements.find('pytz') > -1)
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-08.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = .
bootstrap = no
templates = no
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-11.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = no
templates = no
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-12.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = no
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-13.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-14.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-15.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-16.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-17.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-18.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-19.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-20.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-21.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-22.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-23.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-24.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-25.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-26.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-27.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-28.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-30.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_requirements_invocation(self):
main.execute()
stdout = self.stdout.getvalue()
self.assertTrue(stdout.find('Django<1.9') > -1)
self.assertTrue(stdout.find('django-reversion>=1.10,<1.11') > -1)
self.assertFalse(stdout.find('django-reversion') > -1)
self.assertTrue(stdout.find('djangocms-text-ckeditor') > -1)
self.assertTrue(stdout.find('djangocms-admin-style') > -1)
self.assertTrue(stdout.find('djangocms-column') > -1)
Expand Down

0 comments on commit 06d8c59

Please sign in to comment.