def test_gather_migrations_with_list(self): linter = MigrationLinter() migrations = linter._gather_all_migrations(migrations_list=[ ("app_add_not_null_column", "0001_create_table"), ("app_add_not_null_column", "0002_add_new_not_null_field"), ]) self.assertEqual(2, len(list(migrations)))
def test_gather_all_migrations(self): linter = MigrationLinter(fixtures.CORRECT_PROJECT) migrations = linter._gather_all_migrations() self.assertEqual(len(migrations), 3) self.assertEqual(migrations[0][0], 'test_app1') self.assertEqual(migrations[0][1], '0001_initial') self.assertEqual(migrations[1][0], 'test_app1') self.assertEqual(migrations[1][1], '0002_a_new_null_field') self.assertEqual(migrations[2][0], 'test_app2') self.assertEqual(migrations[2][1], '0001_foo')
def test_gather_all_migrations(self): linter = MigrationLinter(fixtures.CORRECT_PROJECT) migrations = linter._gather_all_migrations() self.assertEqual(len(migrations), 4) self.assertEqual( sorted([(m.app_name, m.name) for m in migrations]), sorted([ ("test_app1", "0001_initial"), ("test_app1", "0002_a_new_null_field"), ("test_app2", "0001_foo"), ("test_app3", "0001_initial"), ]) )
def test_gather_all_migrations(self): linter = MigrationLinter() migrations = linter._gather_all_migrations() self.assertGreater(len(list(migrations)), 1)