'#24155 - Tests ordering of imports.'

def test_sorted_imports(self):

    migration = type('Migration', (migrations.Migration,), {'operations': [migrations.AddField('mymodel', 'myfield', models.DateTimeField(default=datetime.datetime(2012, 1, 1, 1, 1, tzinfo=utc)))]})
    writer = MigrationWriter(migration)
    output = writer.as_string()
    self.assertIn('import    datetime\nfrom    django.db    import    migrations,    models\nfrom    django.utils.timezone    import    utc\n', output)
