Here are the examples of the python api django.db.load_backend taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
0
Example 1
Project: django-mongokit Source File: tests.py
def setUp(self):
if not __django_12__:
# Ugly but necessary
from django.db import load_backend
backend = load_backend('django_mongokit.mongodb')
def get(key):
return getattr(settings, key, None)
self.connection = backend.DatabaseWrapper({
'DATABASE_HOST': get('MONGO_DATABASE_HOST'),
'DATABASE_NAME': settings.MONGO_DATABASE_NAME,
'DATABASE_OPTIONS': get('MONGO_DATABASE_OPTIONS'),
'DATABASE_PASSWORD': get('MONGO_DATABASE_PASSWORD'),
'DATABASE_PORT': get('MONGO_DATABASE_PORT'),
'DATABASE_USER': get('MONGO_DATABASE_USER'),
'TIME_ZONE': settings.TIME_ZONE,
})
self.old_database_name = settings.MONGO_DATABASE_NAME
self.connection.creation.create_test_db()
db = get_database()
assert 'test_' in db.name, db.name