From b0690207103f0f4cd48c95d5567d9da9427eb08d Mon Sep 17 00:00:00 2001 From: Waheed Ahmed Date: Tue, 22 Aug 2017 17:50:49 +0500 Subject: [PATCH 1/2] Remove deprecated field 'sailthru_activation_template'. LEARNER-2201 --- lms/djangoapps/email_marketing/models.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lms/djangoapps/email_marketing/models.py b/lms/djangoapps/email_marketing/models.py index 224fcfebbd..e8b2475410 100644 --- a/lms/djangoapps/email_marketing/models.py +++ b/lms/djangoapps/email_marketing/models.py @@ -47,14 +47,6 @@ class EmailMarketingConfiguration(ConfigurationModel): ) ) - sailthru_activation_template = models.fields.CharField( - max_length=20, - blank=True, - help_text=_( - "DEPRECATED: use sailthru_welcome_template instead." - ) - ) - sailthru_welcome_template = models.fields.CharField( max_length=20, blank=True, From 54b50341bda3739a3e26653a241a32ab391a8cac Mon Sep 17 00:00:00 2001 From: Waheed Ahmed Date: Wed, 23 Aug 2017 14:28:14 +0500 Subject: [PATCH 2/2] Modified migrations sync test. --- common/djangoapps/util/tests/test_db.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/common/djangoapps/util/tests/test_db.py b/common/djangoapps/util/tests/test_db.py index d6529ca26f..e9d7245f8a 100644 --- a/common/djangoapps/util/tests/test_db.py +++ b/common/djangoapps/util/tests/test_db.py @@ -5,12 +5,14 @@ import time import unittest import ddt +from django.conf import settings from django.contrib.auth.models import User from django.core.management import call_command from django.db import IntegrityError, connection from django.db.transaction import TransactionManagementError, atomic from django.test import TestCase, TransactionTestCase from django.test.utils import override_settings +from django.utils.six import StringIO from util.db import NoOpMigrationModules, commit_on_success, enable_named_outer_atomic, generate_int_id, outer_atomic @@ -221,5 +223,14 @@ class MigrationTests(TestCase): The test is set up to override MIGRATION_MODULES to ensure migrations are enabled for purposes of this test regardless of the overall test settings. """ - with self.assertRaises(SystemExit): - call_command('makemigrations', '-e') + out = StringIO() + call_command('makemigrations', dry_run=True, verbosity=3, stdout=out) + output = out.getvalue() + + # Temporary check, remove it once migration is created and use the else part. + if settings.ROOT_URLCONF == 'lms.urls': + migrations_count = output.count('Migrations for') + self.assertIn('Remove field sailthru_activation_template', output) + self.assertEqual(migrations_count, 1) + else: + self.assertIn('No changes detected', output)