'Tests --plan output of showmigrations command with squashed migrations.'

@override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations_squashed_complex'})
def test_showmigrations_plan_squashed(self):

    out = io.StringIO()
    call_command('showmigrations', format='plan', stdout=out)
    self.assertEqual('[    ]        migrations.1_auto\n[    ]        migrations.2_auto\n[    ]        migrations.3_squashed_5\n[    ]        migrations.6_auto\n[    ]        migrations.7_auto\n', out.getvalue().lower())
    out = io.StringIO()
    call_command('showmigrations', format='plan', stdout=out, verbosity=2)
    self.assertEqual('[    ]        migrations.1_auto\n[    ]        migrations.2_auto    ...    (migrations.1_auto)\n[    ]        migrations.3_squashed_5    ...    (migrations.2_auto)\n[    ]        migrations.6_auto    ...    (migrations.3_squashed_5)\n[    ]        migrations.7_auto    ...    (migrations.6_auto)\n', out.getvalue().lower())
    call_command('migrate', 'migrations', '3_squashed_5', verbosity=0)
    out = io.StringIO()
    call_command('showmigrations', format='plan', stdout=out)
    self.assertEqual('[x]        migrations.1_auto\n[x]        migrations.2_auto\n[x]        migrations.3_squashed_5\n[    ]        migrations.6_auto\n[    ]        migrations.7_auto\n', out.getvalue().lower())
    out = io.StringIO()
    call_command('showmigrations', format='plan', stdout=out, verbosity=2)
    self.assertEqual('[x]        migrations.1_auto\n[x]        migrations.2_auto    ...    (migrations.1_auto)\n[x]        migrations.3_squashed_5    ...    (migrations.2_auto)\n[    ]        migrations.6_auto    ...    (migrations.3_squashed_5)\n[    ]        migrations.7_auto    ...    (migrations.6_auto)\n', out.getvalue().lower())
