mirror of
https://github.com/django/daphne.git
synced 2024-11-25 17:23:43 +03:00
2b13b74ce2
* Made daphne installable as a Django app. * Added system check to ensure daphne is installed before django.contrib.staticfiles. * Moved runserver command from Channels. * Added changelog entry for runserver command.
22 lines
698 B
Python
22 lines
698 B
Python
import django
|
|
from django.conf import settings
|
|
from django.test.utils import override_settings
|
|
|
|
from daphne.checks import check_daphne_installed
|
|
|
|
|
|
def test_check_daphne_installed():
|
|
"""
|
|
Test check error is raised if daphne is not listed before staticfiles, and vice versa.
|
|
"""
|
|
settings.configure(
|
|
INSTALLED_APPS=["daphne.apps.DaphneConfig", "django.contrib.staticfiles"]
|
|
)
|
|
django.setup()
|
|
errors = check_daphne_installed(None)
|
|
assert len(errors) == 0
|
|
with override_settings(INSTALLED_APPS=["django.contrib.staticfiles", "daphne"]):
|
|
errors = check_daphne_installed(None)
|
|
assert len(errors) == 1
|
|
assert errors[0].id == "daphne.E001"
|