Merge branch 'development'
[django-tables2.git] / tests / __init__.py
index db2ee0d42ac69bb3d6b121171252df0d2ef65279..d592d868211675bc851599bda28bd007e9f8d1c0 100644 (file)
@@ -1,3 +1,31 @@
-# make django-tables available for import for tests
-import os, sys
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+from attest import AssertImportHook, Tests
+
+# Django's django.utils.module_loading.module_has_submodule is busted
+AssertImportHook.disable()
+
+
+from django.conf import settings
+
+# It's important to configure prior to importing the tests, as some of them
+# import Django's DB stuff.
+settings.configure(
+    DATABASES = {
+        'default': {
+            'ENGINE': 'django.db.backends.sqlite3',
+            'NAME': ':memory:',
+        }
+    },
+    INSTALLED_APPS = [
+        'tests.testapp',
+        'django_tables',
+    ]
+)
+
+
+from .core import core
+from .templates import templates
+from .models import models
+from .utils import utils
+
+
+everything = Tests([core, templates, models, utils])