# -*- coding: utf-8 -*-
import unittest
from tests.utils import has_django

from thumbnails.cache_backends import SimpleCacheBackend, DjangoCacheBackend
from thumbnails.engines import PillowEngine
from thumbnails.helpers import generate_filename, get_cache_backend, get_engine
from thumbnails.images import SourceFile


class HelpersTestCase(unittest.TestCase):

    def test_generate_filename(self):
        self.assertEqual(
            generate_filename(SourceFile('url'), '100x200', 'center', None),
            ['0af', 'a360db703bd5c2fe7c83843ce7738a0a6d37b']
        )
        self.assertEqual(
            generate_filename(SourceFile('url'), '200x200', 'center', None),
            ['851', '521c21fe9709802e9d4eb20a5fe84c18cd3ad']
        )

    def test_get_engine(self):
        self.assertIsInstance(get_engine(), PillowEngine)

    def test_get_cache_backend(self):
        if has_django():
            self.assertIsInstance(get_cache_backend(), DjangoCacheBackend)
        else:
            self.assertIsInstance(get_cache_backend(), SimpleCacheBackend)

@@ -33,16 +33,17 @@
 nittest%0A
+%0A
 from tes
@@ -69,17 +69,16 @@
 _django%0A
-%0A
 from thu
@@ -107,22 +107,22 @@
  import 
-Simple
+Django
 CacheBac
@@ -127,22 +127,22 @@
 ackend, 
-Django
+Simple
 CacheBac

Fix isort