Beispiel #1
0
 def test_generated_image_assets(self):
     tasks.generate_image_assets(self.app)
     for asset in APP_IMAGE_SIZES:
         ia = ImageAsset.objects.get(addon=self.app, slug=asset['slug'])
         with storage.open(ia.image_path) as fp:
             im = Image.open(fp)
             im.load()
         eq_(im.size, asset['size'])
Beispiel #2
0
 def test_generated_image_assets(self):
     tasks.generate_image_assets(self.app)
     for asset in APP_IMAGE_SIZES:
         ia = ImageAsset.objects.get(addon=self.app,
                                     slug=asset['slug'])
         with storage.open(ia.image_path) as fp:
             im = Image.open(fp)
             im.load()
         eq_(im.size, asset['size'])
Beispiel #3
0
 def test_use_64(self):
     # There's an icon set up for this ID that has the path that the
     # generator would expect for a 64x64px icon. It should fallback
     # on that one, since there isn't a 128x128px icon.
     tasks.generate_image_assets(self.app)
     for asset in APP_IMAGE_SIZES:
         ia = ImageAsset.objects.get(addon=self.app, slug=asset['slug'])
         with storage.open(ia.image_path) as fp:
             im = Image.open(fp)
             im.load()
         eq_(im.size, asset['size'])
Beispiel #4
0
 def test_use_64(self):
     # There's an icon set up for this ID that has the path that the
     # generator would expect for a 64x64px icon. It should fallback
     # on that one, since there isn't a 128x128px icon.
     tasks.generate_image_assets(self.app)
     for asset in APP_IMAGE_SIZES:
         ia = ImageAsset.objects.get(addon=self.app,
                                     slug=asset['slug'])
         with storage.open(ia.image_path) as fp:
             im = Image.open(fp)
             im.load()
         eq_(im.size, asset['size'])
Beispiel #5
0
    def test_generated_image_assets_slug(self):
        # We're going to generate assets for only one type.
        asset = APP_IMAGE_SIZES[0]
        slug = asset['slug']

        tasks.generate_image_assets(self.app, slug=slug)
        ia = ImageAsset.objects.filter(addon=self.app)
        eq_(list(a.slug for a in ia), [slug])

        with storage.open(ia[0].image_path) as fp:
            im = Image.open(fp)
            im.load()
        eq_(im.size, asset['size'])
Beispiel #6
0
    def test_generated_image_assets_slug(self):
        # We're going to generate assets for only one type.
        asset = APP_IMAGE_SIZES[0]
        slug = asset['slug']

        tasks.generate_image_assets(self.app, slug=slug)
        ia = ImageAsset.objects.filter(addon=self.app)
        eq_(list(a.slug for a in ia), [slug])

        with storage.open(ia[0].image_path) as fp:
            im = Image.open(fp)
            im.load()
        eq_(im.size, asset['size'])