def test_autocreation(self):
     from models import MediaVariation
     MediaVariation.register_preselection(
         ('cropscale50x50', _('50px Square Thumbnail'), 'image-cropscale', {'height' : 50, 'width' : 50}),
         ('thumbnail150x99999', _('Max 150px wide image'), 'image-thumbnail', {'height' : 150, 'width' : 99999}),
     )
     from extensions import auto_creation
     MediaFile.register_extension(auto_creation)
     MediaFile.register_variation_auto_creation('cropscale50x50', 'thumbnail150x99999')
     self.assertEqual(MediaFile.variation_auto_creation, ['cropscale50x50', 'thumbnail150x99999'])
     processed = self.image.get_variation('cropscale50x50')
     self.assertEqual(get_image_dimensions(processed.file), (50, 50))
from feincms.module.medialibrary.models import MediaFile
from mediavariations.contrib.feincms.extensions import variations


MediaFile.register_extension(variations)
 def setUp(self):
     from extensions import media_variation
     MediaFile.register_extension(media_variation)
     mediafile = MediaFile(file=File(open('feinheit/media_variations/fixtures/elephant_test_image.jpeg')))
     mediafile.save()
     self.image = mediafile
from feincms.module.page.models import Page
from feincms.module.medialibrary.models import MediaFile
from feincms.content.richtext.models import RichTextContent
from feincms.content.medialibrary.v2 import MediaFileContent

from feincms_oembed.contents import OembedContent, FeedContent

from mediavariations.contrib.feincms.extensions import variations

from contents import AnnouncementContent, SimpleGalleryContent, \
    TextContent, NewswallContent, FacebookImagePostsContent, WeatherContent
from extensions import content_timing_extension, mediafile_cover_extension, \
    page_location

#MediaFile.register_extension(variations)
MediaFile.register_extension(mediafile_cover_extension)

Page.register_templates({
    'title': 'Standard Screen',
    'path': 'screen.html',
    'regions': (
        ('main', _('Main content area')),
        ('announcements', _('Announcements'), 'inherited'),
        ('inactive', _('Inactive')),
        ),
    })

content_timing_extension(RichTextContent, TextContent, MediaFileContent, OembedContent,
    SimpleGalleryContent, AnnouncementContent, FacebookImagePostsContent, NewswallContent,
    WeatherContent)