'A new squash migration will be marked as applied even if all its
replaced migrations were previously already applied (#24628).'

@override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations_squashed'})
def test_migrate_marks_replacement_applied_even_if_it_did_nothing(self):

    recorder = MigrationRecorder(connection)
    recorder.record_applied('migrations', '0001_initial')
    recorder.record_applied('migrations', '0002_second')
    executor = MigrationExecutor(connection)
    executor.migrate([('migrations', '0001_squashed_0002')])
    self.assertIn(('migrations', '0001_squashed_0002'), recorder.applied_migrations())
