From cdb32c7c351c46cd5c1663fe8e4c947444ace8d4 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 23 Jul 2014 07:35:29 +0200 Subject: [PATCH 1/2] Update dependency versions and fix tests --- djangocms_installer/config/data.py | 10 +++++----- tests/config.py | 10 +++++----- tests/django.py | 8 ++++++-- tests/main.py | 2 +- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/djangocms_installer/config/data.py b/djangocms_installer/config/data.py index 69a750c..769f45c 100644 --- a/djangocms_installer/config/data.py +++ b/djangocms_installer/config/data.py @@ -30,7 +30,7 @@ DJANGOCMS_3_REQUIREMENTS = """ django-mptt>=0.6 -djangocms-text-ckeditor>=2.0.5 +djangocms-text-ckeditor>=2.1.4 djangocms-admin-style djangocms-column djangocms-style @@ -47,18 +47,18 @@ djangocms-video """ -DJANGO_16_REVERSION = "django-reversion==1.8" +DJANGO_16_REVERSION = "django-reversion>=1.8" DJANGO_15_REVERSION = "django-reversion>=1.7,<1.8" DJANGO_14_REVERSION = "django-reversion<1.7" FILER_REQUIREMENTS_CMS3 = """ easy_thumbnails -https://github.com/stefanfoulis/django-filer/archive/develop.zip -https://github.com/stefanfoulis/cmsplugin-filer/archive/develop.zip +django-filer>=0.9.6 +cmsplugin-filer>=0.9.9 """ FILER_REQUIREMENTS_CMS2 = """ easy_thumbnails -django-filer +django-filer<=0.9.6 cmsplugin_filer """ diff --git a/tests/config.py b/tests/config.py index cae3357..564df66 100644 --- a/tests/config.py +++ b/tests/config.py @@ -181,7 +181,7 @@ def test_requirements(self): self.assertTrue(conf_data.requirements.find('Django<1.5') > -1) self.assertTrue(conf_data.requirements.find('django-filer') > -1) self.assertTrue(conf_data.requirements.find('cmsplugin-filer') > -1) - self.assertTrue(conf_data.requirements.find('django-reversion==1.8') > -1) + self.assertTrue(conf_data.requirements.find('django-reversion>=1.8') > -1) self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor') > -1) conf_data = config.parse([ @@ -223,7 +223,7 @@ def test_requirements(self): self.assertTrue(conf_data.requirements.find('django-cms<3.1') > -1) self.assertTrue(conf_data.requirements.find('Django<1.7') > -1) - self.assertTrue(conf_data.requirements.find('django-reversion==1.8') > -1) + self.assertTrue(conf_data.requirements.find('django-reversion>=1.8') > -1) self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor') > -1) self.assertTrue(conf_data.requirements.find('djangocms-admin-style') > -1) self.assertTrue(conf_data.requirements.find('djangocms-column') > -1) @@ -250,7 +250,7 @@ def test_requirements(self): self.assertTrue(conf_data.requirements.find(config.data.DJANGOCMS_DEVELOP) > -1) self.assertTrue(conf_data.requirements.find('Django<1.7') > -1) - self.assertTrue(conf_data.requirements.find('django-reversion==1.8') > -1) + self.assertTrue(conf_data.requirements.find('django-reversion>=1.8') > -1) self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor') > -1) self.assertTrue(conf_data.requirements.find('djangocms-admin-style') > -1) self.assertTrue(conf_data.requirements.find('django-filer') > -1) @@ -279,7 +279,7 @@ def test_requirements(self): self.assertTrue(conf_data.requirements.find(config.data.DJANGOCMS_DEVELOP) > -1) self.assertTrue(conf_data.requirements.find('Django<1.5') > -1) - self.assertTrue(conf_data.requirements.find('django-reversion==1.8') > -1) + self.assertTrue(conf_data.requirements.find('django-reversion>=1.8') > -1) conf_data = config.parse([ '-q', @@ -297,7 +297,7 @@ def test_requirements(self): self.assertTrue(conf_data.requirements.find('Django<1.7') > -1) self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor') > -1) self.assertTrue(conf_data.requirements.find('djangocms-admin-style') > -1) - self.assertTrue(conf_data.requirements.find('django-reversion==1.8') > -1) + self.assertTrue(conf_data.requirements.find('django-reversion>=1.8') > -1) self.assertTrue(conf_data.requirements.find('pytz') > -1) def test_boostrap(self): diff --git a/tests/django.py b/tests/django.py index ebb4ca5..58cbf4e 100644 --- a/tests/django.py +++ b/tests/django.py @@ -227,7 +227,7 @@ def test_patch_24_filer(self): '--cms-version=2.4', '-f', '-q', '-u', '-zno', '--i18n=no', '-p'+self.project_dir, 'example_path_24_f']) - + reqs = config_data.requirements.replace('django-mptt>=0.5.1,<0.5.3', '') install.requirements(config_data.requirements) django.create_project(config_data) django.patch_settings(config_data) @@ -358,7 +358,7 @@ def test_database_setup_filer(self): def test_database_setup(self): config_data = config.parse(['--db=sqlite://localhost/test.db', - '-q', '-u', '--cms-version=3.0', + '-q', '--cms-version=3.0', '-p'+self.project_dir, 'cms_project']) install.requirements(config_data.requirements) django.create_project(config_data) @@ -376,3 +376,7 @@ def test_database_setup(self): query = project_db.execute('SELECT * FROM cms_page') self.assertTrue(query) + # No data in auth tables at setup time due to the no-input + query = project_db.execute('SELECT * FROM auth_user') + self.assertTrue(query) + diff --git a/tests/main.py b/tests/main.py index e241848..f25f1f8 100644 --- a/tests/main.py +++ b/tests/main.py @@ -20,7 +20,7 @@ def test_requirements_invocation(self): main.execute() stdout = self.stdout.getvalue() self.assertTrue(stdout.find('Django<1.7') > -1) - self.assertTrue(stdout.find('django-reversion==1.8') > -1) + self.assertTrue(stdout.find('django-reversion>=1.8') > -1) self.assertTrue(stdout.find('djangocms-text-ckeditor') > -1) self.assertTrue(stdout.find('djangocms-admin-style') > -1) self.assertTrue(stdout.find('djangocms-column') > -1) From bc3db0d9777e458b5c2eac12f4e1d0e1472ff8c7 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 23 Jul 2014 07:35:34 +0200 Subject: [PATCH 2/2] Fix asking for creating user even when --no-input flag is used --- djangocms_installer/django/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djangocms_installer/django/__init__.py b/djangocms_installer/django/__init__.py index 12fbff5..59f9b5b 100644 --- a/djangocms_installer/django/__init__.py +++ b/djangocms_installer/django/__init__.py @@ -272,7 +272,7 @@ def setup_database(config_data): subprocess.check_call([sys.executable, "-W", "ignore", "manage.py", "syncdb", "--noinput"]) print("south not installed, migrations skipped") - if not config_data.no_user: + if not config_data.no_user and not config_data.noinput: print("\n\nCreating admin user") subprocess.check_call([sys.executable, "-W", "ignore", "manage.py", "createsuperuser"])