def test_translated_field_supports_migration():
 fields = {'charfield': TranslatedField()}
 migration = type(str('Migration'), (migrations.Migration,), {'operations': [migrations.CreateModel(name='MyModel', fields=tuple(fields.items()), bases=(models.Model,))]})
 writer = MigrationWriter(migration)
 output = writer.as_string()
 result = safe_exec(output, globals_=globals())
 assert ('Migration' in result)

def test_translated_field_supports_migration ( ) : fields = { 'charfield' : TranslatedField ( ) } migration = type ( str ( 'Migration' ) , ( migrations . Migration , ) , { 'operations' : [ migrations . CreateModel ( name = 'MyModel' , fields = tuple ( fields . items ( ) ) , bases = ( models . Model , ) ) ] } ) writer = MigrationWriter ( migration ) output = writer . as_string ( ) result = safe_exec ( output , globals_ = globals ( ) ) assert ( 'Migration' in result )
tests serializing translated field in a simple migration .