Skip to content

Commit

Permalink
Merge pull request #125 from nephila/feature/fix_tests
Browse files Browse the repository at this point in the history
Update requirements - Fix noinput flag
  • Loading branch information
yakky committed Jul 23, 2014
2 parents 414940f + bc3db0d commit 46fc887
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
10 changes: 5 additions & 5 deletions djangocms_installer/config/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
"""

Expand Down
2 changes: 1 addition & 1 deletion djangocms_installer/django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
10 changes: 5 additions & 5 deletions tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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',
Expand All @@ -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):
Expand Down
8 changes: 6 additions & 2 deletions tests/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)

2 changes: 1 addition & 1 deletion tests/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 46fc887

Please sign in to comment.