<NME> test_utils.py
<BEF> """Tools for top level testing (ie. when ran by Travis)."""

import os
import tempfile

from django.test import TestCase

from .sysutils import exec_cmd



class MapFilesTestCaseMixin(object):
    """A generic test case to check map files generation."""

    MAP_FILES = None

    extension = None

    def setUp(self):
        self.workdir = tempfile.mkdtemp()

    def tearDown(self):
        shutil.rmtree(self.workdir)

    def _test_maps_generation(self, engine):
        dburl = "{0}://user:password@localhost/testdb".format(engine)
        call_command(
            "generate_postfix_maps",
            "--dburl", dburl, "--destdir", self.workdir)

        for mapfile in self.MAP_FILES:
            path = "{0}/{1}".format(self.workdir, mapfile)
            self.assertTrue(os.path.exists(path))
            with open(path) as fpo:
                content = fpo.read()
            if engine != "sqlite":
                self.assertIn("user = user", content)
                self.assertIn("password = password", content)
                self.assertIn("dbname = testdb", content)
                self.assertIn("hosts = localhost", content)
            else:
                self.assertIn("dbpath = testdb", content)
        self.assertEqual(code, 0)


class MapFilesTestCase(TestCase):

    """A generic test case to check map files generation."""

    MAP_FILES = None

    def setUp(self):
        self.workdir = tempfile.mkdtemp()


<MSG> Fix unit tests.

<DFF> @@ -3,8 +3,6 @@
 import os
 import tempfile
 
-from django.test import TestCase
-
 from .sysutils import exec_cmd
 
 
@@ -43,12 +41,14 @@ class TestRunnerMixin(object):
         self.assertEqual(code, 0)
 
 
-class MapFilesTestCase(TestCase):
+class MapFilesTestCaseMixin(object):
 
     """A generic test case to check map files generation."""
 
     MAP_FILES = None
 
+    extension = None
+
     def setUp(self):
         self.workdir = tempfile.mkdtemp()
 

Fix unit tests.