summaryrefslogtreecommitdiff
path: root/conftest.py
diff options
context:
space:
mode:
authorDavid Cramer <dcramer@gmail.com>2012-12-07 15:22:03 -0800
committerDavid Cramer <dcramer@gmail.com>2012-12-07 15:22:03 -0800
commite84a5bc6af3ae064c24c8c6005c9d3aaf4aadf61 (patch)
treea47717df897db02033f37d0f34fea17351fe1dec /conftest.py
parent0b4859eb7875b4add3cee32dae9e434700aea0ac (diff)
downloadraven-e84a5bc6af3ae064c24c8c6005c9d3aaf4aadf61.tar.gz
use conftest.py
Diffstat (limited to 'conftest.py')
-rw-r--r--conftest.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/conftest.py b/conftest.py
new file mode 100644
index 0000000..0de28ee
--- /dev/null
+++ b/conftest.py
@@ -0,0 +1,46 @@
+from django.conf import settings
+import os.path
+
+
+def pytest_configure(config):
+ where_am_i = os.path.dirname(os.path.abspath(__file__))
+
+ if not settings.configured:
+ settings.configure(
+ DATABASE_ENGINE='sqlite3',
+ DATABASES={
+ 'default': {
+ 'NAME': ':memory:',
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'TEST_NAME': ':memory:',
+ },
+ },
+ DATABASE_NAME=':memory:',
+ TEST_DATABASE_NAME=':memory:',
+ INSTALLED_APPS=[
+ 'django.contrib.auth',
+ 'django.contrib.admin',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+
+ # Included to fix Disqus' test Django which solves IntegrityMessage case
+ 'django.contrib.contenttypes',
+
+ 'djcelery', # celery client
+
+ 'raven.contrib.django',
+ ],
+ ROOT_URLCONF='',
+ DEBUG=False,
+ SITE_ID=1,
+ BROKER_HOST="localhost",
+ BROKER_PORT=5672,
+ BROKER_USER="guest",
+ BROKER_PASSWORD="guest",
+ BROKER_VHOST="/",
+ CELERY_ALWAYS_EAGER=True,
+ TEMPLATE_DEBUG=True,
+ TEMPLATE_DIRS=[os.path.join(where_am_i, 'tests', 'contrib', 'django', 'templates')],
+ )
+ import djcelery
+ djcelery.setup_loader()