Skip to content

Commit 91c8ab5

Browse files
add test setting for db (#70)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2790525 commit 91c8ab5

File tree

7 files changed

+16
-11
lines changed

7 files changed

+16
-11
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2626

2727
- `project.yml` GitHub Actions workflow file. This is now taken care of by a custom GitHub bot.
2828

29+
### Fixed
30+
31+
- Now mirroring the `default` database when testing. This is the recommendation from the Django documentation.
32+
2933
## [2024.7]
3034

3135
### Added

examples/default/Justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ docs-serve:
101101

102102
docs-build LOCATION="docs/_build/html":
103103
just _cog
104-
sphinx-build docs
104+
sphinx-build docs
105105

106106
# ----------------------------------------------------------------------
107107
# DOCKER

examples/default/default/settings.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
DISABLE_SERVER_SIDE_CURSORS := env.bool("DISABLE_SERVER_SIDE_CURSORS", default=True)
6969
):
7070
DATABASES["default"]["DISABLE_SERVER_SIDE_CURSORS"] = DISABLE_SERVER_SIDE_CURSORS
71-
DATABASES[EMAIL_RELAY_DATABASE_ALIAS][
72-
"DISABLE_SERVER_SIDE_CURSORS"
73-
] = DISABLE_SERVER_SIDE_CURSORS
71+
DATABASES[EMAIL_RELAY_DATABASE_ALIAS]["DISABLE_SERVER_SIDE_CURSORS"] = (
72+
DISABLE_SERVER_SIDE_CURSORS
73+
)
7474

7575
DATABASE_ROUTERS = [
7676
"email_relay.db.EmailDatabaseRouter",

examples/with_vite/Justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ docs-serve:
101101

102102
docs-build LOCATION="docs/_build/html":
103103
just _cog
104-
sphinx-build docs
104+
sphinx-build docs
105105

106106
# ----------------------------------------------------------------------
107107
# DOCKER

examples/with_vite/pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ tag = false
77
version_pattern = "YYYY.MM.INC1"
88

99
[tool.bumpver.file_patterns]
10-
"with_vite/__init__.py" = [
11-
'__version__ = "{version}"'
12-
]
1310
"tests/test_version.py" = [
1411
'assert __version__ == "{version}"'
1512
]
13+
"with_vite/__init__.py" = [
14+
'__version__ = "{version}"'
15+
]
1616

1717
[tool.coverage.report]
1818
exclude_lines = [

examples/with_vite/with_vite/settings.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
DISABLE_SERVER_SIDE_CURSORS := env.bool("DISABLE_SERVER_SIDE_CURSORS", default=True)
6969
):
7070
DATABASES["default"]["DISABLE_SERVER_SIDE_CURSORS"] = DISABLE_SERVER_SIDE_CURSORS
71-
DATABASES[EMAIL_RELAY_DATABASE_ALIAS][
72-
"DISABLE_SERVER_SIDE_CURSORS"
73-
] = DISABLE_SERVER_SIDE_CURSORS
71+
DATABASES[EMAIL_RELAY_DATABASE_ALIAS]["DISABLE_SERVER_SIDE_CURSORS"] = (
72+
DISABLE_SERVER_SIDE_CURSORS
73+
)
7474

7575
DATABASE_ROUTERS = [
7676
"email_relay.db.EmailDatabaseRouter",

src/django_twc_project/{{ module_name }}/settings.py.jinja

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ if not DEBUG and (
7171
DATABASES[EMAIL_RELAY_DATABASE_ALIAS][
7272
"DISABLE_SERVER_SIDE_CURSORS"
7373
] = DISABLE_SERVER_SIDE_CURSORS
74+
DATABASES[EMAIL_RELAY_DATABASE_ALIAS]["TEST"] = {"MIRROR": "default"}
7475

7576
DATABASE_ROUTERS = [
7677
"email_relay.db.EmailDatabaseRouter",

0 commit comments

Comments
 (0)