From ab7929648effd815b2d56eaef51d54fe1107ff15 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 31 Aug 2016 22:19:30 +0200 Subject: [PATCH 1/3] Use correct model in migrations --- djangocms_blog/migrations/0021_auto_20160823_2008.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/djangocms_blog/migrations/0021_auto_20160823_2008.py b/djangocms_blog/migrations/0021_auto_20160823_2008.py index 5ab8fb4b..1026e244 100644 --- a/djangocms_blog/migrations/0021_auto_20160823_2008.py +++ b/djangocms_blog/migrations/0021_auto_20160823_2008.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.9 on 2016-08-23 18:08 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion +from djangocms_blog.models import thumbnail_model class Migration(migrations.Migration): @@ -16,26 +16,26 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='authorentriesplugin', name='cmsplugin_ptr', - field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_blog_authorentriesplugin', serialize=False, to='cms.CMSPlugin'), + field=models.OneToOneField(parent_link=True, related_name='djangocms_blog_authorentriesplugin', auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin'), ), migrations.AlterField( model_name='genericblogplugin', name='cmsplugin_ptr', - field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_blog_genericblogplugin', serialize=False, to='cms.CMSPlugin'), + field=models.OneToOneField(parent_link=True, related_name='djangocms_blog_genericblogplugin', auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin'), ), migrations.AlterField( model_name='latestpostsplugin', name='cmsplugin_ptr', - field=models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='djangocms_blog_latestpostsplugin', serialize=False, to='cms.CMSPlugin'), + field=models.OneToOneField(parent_link=True, related_name='djangocms_blog_latestpostsplugin', auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin'), ), migrations.AlterField( model_name='post', name='main_image_full', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='djangocms_blog_post_full', to='filer.ThumbnailOption', verbose_name='main image full'), + field=models.ForeignKey(related_name='djangocms_blog_post_full', on_delete=django.db.models.deletion.SET_NULL, verbose_name='main image full', blank=True, to=thumbnail_model, null=True), ), migrations.AlterField( model_name='post', name='main_image_thumbnail', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='djangocms_blog_post_thumbnail', to='filer.ThumbnailOption', verbose_name='main image thumbnail'), + field=models.ForeignKey(related_name='djangocms_blog_post_thumbnail', on_delete=django.db.models.deletion.SET_NULL, verbose_name='main image thumbnail', blank=True, to=thumbnail_model, null=True), ), ] From f6ffd0a63b475d77e64dc56c4d8021820b626a7d Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Fri, 2 Sep 2016 07:52:08 +0200 Subject: [PATCH 2/3] Use 0.9 branch of djangocms-helper --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index f339fb79..c5d42310 100644 --- a/tox.ini +++ b/tox.ini @@ -41,7 +41,7 @@ deps = knocker: djangocms-text-ckeditor<3.0 django-meta>=1.2 html5lib<0.99999999 - https://github.com/nephila/djangocms-helper/archive/develop.zip + https://github.com/nephila/djangocms-helper/archive/release/0.9.x.zip https://github.com/aldryn/aldryn-apphooks-config/archive/master.zip https://github.com/nephila/djangocms-apphook-setup/archive/master.zip -r{toxinidir}/requirements-test.txt From a74348df2b670cd7f767facd574c4bc35f8c7ebf Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 3 Sep 2016 22:23:16 +0200 Subject: [PATCH 3/3] Do not enable auto setup during tests --- cms_helper.py | 1 + tests/test_setup.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/cms_helper.py b/cms_helper.py index c07f3e3d..ad35c1b9 100755 --- a/cms_helper.py +++ b/cms_helper.py @@ -96,6 +96,7 @@ def gettext(s): return s HAYSTACK_CONNECTIONS={ 'default': {} }, + BLOG_AUTO_SETUP=False, ) try: diff --git a/tests/test_setup.py b/tests/test_setup.py index cfe8691b..5933ca3e 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -12,7 +12,13 @@ from .base import BaseTest +try: + from django.test import override_settings +except ImportError: + from django.test.utils import override_settings + +@override_settings(BLOG_AUTO_SETUP=True) class SetupTest(BaseTest): @classmethod