Add sessions app to INSTALLED_APPS and corresponding tests
This commit is contained in:
parent
92ec9e5f32
commit
45c581715a
2 changed files with 13 additions and 0 deletions
|
|
@ -140,6 +140,7 @@ LOGGING: dict[str, Any] = {
|
||||||
|
|
||||||
INSTALLED_APPS: list[str] = [
|
INSTALLED_APPS: list[str] = [
|
||||||
"django.contrib.contenttypes",
|
"django.contrib.contenttypes",
|
||||||
|
"django.contrib.sessions",
|
||||||
"django.contrib.staticfiles",
|
"django.contrib.staticfiles",
|
||||||
"twitch.apps.TwitchConfig",
|
"twitch.apps.TwitchConfig",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ from contextlib import contextmanager
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from django.contrib.sessions.models import Session
|
||||||
|
|
||||||
from config import settings
|
from config import settings
|
||||||
|
|
||||||
|
|
@ -122,3 +123,14 @@ def test_debug_defaults_true_when_missing(reload_settings_module: Callable[...,
|
||||||
reloaded: ModuleType = reload_settings_module(DEBUG=None)
|
reloaded: ModuleType = reload_settings_module(DEBUG=None)
|
||||||
|
|
||||||
assert reloaded.DEBUG is True
|
assert reloaded.DEBUG is True
|
||||||
|
|
||||||
|
|
||||||
|
def test_sessions_app_installed() -> None:
|
||||||
|
"""Sessions app should be registered when session middleware is enabled."""
|
||||||
|
assert "django.contrib.sessions" in settings.INSTALLED_APPS
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.django_db
|
||||||
|
def test_session_table_exists() -> None:
|
||||||
|
"""The sessions table should be available in the database."""
|
||||||
|
Session.objects.count()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue