File: test_runserver_nostatic.py

package info (click to toggle)
python-whitenoise 6.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 472 kB
  • sloc: python: 2,040; makefile: 132; javascript: 10
file content (16 lines) | stat: -rw-r--r-- 528 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from __future__ import annotations

from django.core.management import get_commands
from django.core.management import load_command_class


def get_command_instance(name):
    app_name = get_commands()[name]
    return load_command_class(app_name, name)


def test_command_output():
    command = get_command_instance("runserver")
    parser = command.create_parser("manage.py", "runserver")
    assert "Wrapped by 'whitenoise.runserver_nostatic'" in parser.format_help()
    assert not parser.get_default("use_static_handler")