'Running a single squashed migration should record all of the original
replaced migrations as run.'

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

    recorder = MigrationRecorder(connection)
    out = io.StringIO()
    call_command('migrate', 'migrations', verbosity=0)
    call_command('showmigrations', 'migrations', stdout=out, no_color=True)
    self.assertEqual('migrations\n    [x]    0001_squashed_0002    (2    squashed    migrations)\n', out.getvalue().lower())
    applied_migrations = recorder.applied_migrations()
    self.assertIn(('migrations', '0001_initial'), applied_migrations)
    self.assertIn(('migrations', '0002_second'), applied_migrations)
    self.assertIn(('migrations', '0001_squashed_0002'), applied_migrations)
    call_command('migrate', 'migrations', 'zero', verbosity=0)
