File: multi_db_settings.py

package info (click to toggle)
django-oauth-toolkit 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,156 kB
  • sloc: python: 11,100; makefile: 159; javascript: 9; sh: 6
file content (19 lines) | stat: -rw-r--r-- 560 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Import the test settings and then override DATABASES.

from .settings import *  # noqa: F401, F403


DATABASES = {
    "alpha": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": ":memory:",
    },
    "beta": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": ":memory:",
    },
    # As https://docs.djangoproject.com/en/4.2/topics/db/multi-db/#defining-your-databases
    # indicates, it is ok to have no default database.
    "default": {},
}
DATABASE_ROUTERS = ["tests.db_router.AlphaRouter", "tests.db_router.BetaRouter"]