'Tests making migrations with Django 1.7+\'s migration framework'

@unittest.skipIf(((django.VERSION[0] <= 1) and (django.VERSION[1] <= 6)), 'Migrations    are    handled    by    south    in    Django    <1.7')
def test_17_migration(self):

    fields = {'autoslugfield': AutoSlugField(populate_from='otherfield')}
    migration = type(str('Migration'), (migrations.Migration,), {'operations': [migrations.CreateModel('MyModel', tuple(fields.items()), {'populate_from': 'otherfield'}, (models.Model,))]})
    writer = MigrationWriter(migration)
    output = writer.as_string()
    self.assertIsInstance(output, six.binary_type, 'Migration    as_string    returned    unicode')
    result = self.safe_exec(output)
    self.assertIn('Migration', result)
