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

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()
    if (django.VERSION < (1, 11)):
        self.assertIsInstance(output, six.binary_type, 'Migration    as_string    returned    unicode')
    else:
        self.assertIsInstance(output, six.text_type, 'Migration    as_string    returned    bytes')
    result = self.safe_exec(output)
    self.assertIn('Migration', result)
