Finish up cache and fix tests.

Still TODO: Merge with ignore functionality.
This commit is contained in:
Felix committed 2018-12-20 14:45:35 +01:00
1 parent 9608e99150
commit b68c0183bb
11 files changed
+263 -106

No files matched your search

+3 -21
View File
@@ -32,13 +32,13 @@ class TestLinterFunctions(unittest.TestCase):
linter = MigrationLinter(project_path)
self.assertFalse(linter.has_errors)
linter.lint_migration('test_app', '0001')
linter.lint_migration('test_app', '0001_create_table')
self.assertFalse(linter.has_errors)
linter.lint_migration('test_app', '0002')
linter.lint_migration('test_app', '0002_add_new_not_null_field')
self.assertTrue(linter.has_errors)
linter.lint_migration('test_app', '0001')
linter.lint_migration('test_app', '0001_create_table')
self.assertTrue(linter.has_errors)
def test_linter_creation(self):
@@ -49,24 +49,6 @@ class TestLinterFunctions(unittest.TestCase):
with self.assertRaises(ValueError):
MigrationLinter(fixtures.NOT_DJANGO_GIT_PROJECT)
def test_split_migration_long_path(self):
input_path = 'apps/the_app/migrations/0001_stuff.py'
app, mig = MigrationLinter._split_migration_path(input_path)
self.assertEqual(app, 'the_app')
self.assertEqual(mig, '0001_stuff')
def test_split_migration_path(self):
input_path = 'the_app/migrations/0001_stuff.py'
app, mig = MigrationLinter._split_migration_path(input_path)
self.assertEqual(app, 'the_app')
self.assertEqual(mig, '0001_stuff')
def test_split_migration_full_path(self):
input_path = '/home/user/djangostuff/apps/the_app/migrations/0001_stuff.py'
app, mig = MigrationLinter._split_migration_path(input_path)
self.assertEqual(app, 'the_app')
self.assertEqual(mig, '0001_stuff')
def test_ignore_migration_include_apps(self):
linter = MigrationLinter(
fixtures.ADD_NOT_NULL_COLUMN_PROJECT,