Remove duplication

This commit is contained in:
Felix authored and David Wobrock committed 2018-12-23 17:46:57 +01:00
1 parent ff8e1b4363
commit 6fe51d2e08
4 files changed
+8 -6

No files matched your search

+1
View File
@@ -13,3 +13,4 @@
# limitations under the License.
from .migration_linter import * # noqa
from .constants import * # noqa
+4
View File
@@ -0,0 +1,4 @@
# Can be used to mark ignored migrations.
# This is a noop for SQL. Comments would be better.
# But comments are stripped by RunSQL
IGNORE_MIGRATION = ("SELECT 'dml-ignore'", )
@@ -24,11 +24,6 @@ from .sql_analyser import analyse_sql_statements
logger = logging.getLogger(__name__)
# Can be used to mark ignored migrations.
# This is a noop for SQL. Comments would be better.
# But comments are stripped by RunSQL
IGNORE_MIGRATION = ("SELECT 'dml-ignore'", )
class MigrationLinter(object):
MIGRATION_FOLDER_NAME = 'migrations'
+3 -1
View File
@@ -15,6 +15,8 @@
import re
import logging
from django_migration_linter.constants import IGNORE_MIGRATION
logger = logging.getLogger(__name__)
@@ -65,7 +67,7 @@ migration_tests = (
'err_msg': ''
}, {
'code': 'IGNORED_MIGRATION',
'fn': lambda sql, **kw: re.search('dml-ignore', sql),
'fn': lambda sql, **kw: re.search(IGNORE_MIGRATION[0], sql),
'err_msg': '',
}
)