aboutsummaryrefslogtreecommitdiffstats
path: root/manage.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-10-27 01:46:27 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-10-27 01:49:48 +0400
commit71319de89593978de8d6725d1b405d8735d100a5 (patch)
tree6cabe7bb3a4688d0484583287e1114c71faf5a66 /manage.py
parentRename Tag Model Author Field (diff)
parentUpdate off-topic etiquette to reflect server size (#785) (diff)
Merge branch 'main' into bot-tags
Signed-off-by: Hassan Abouelela <[email protected]> # Conflicts: # poetry.lock # pydis_site/settings.py # pyproject.toml
Diffstat (limited to 'manage.py')
-rwxr-xr-xmanage.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/manage.py b/manage.py
index 697960c6..37fb141f 100755
--- a/manage.py
+++ b/manage.py
@@ -7,6 +7,7 @@ from pathlib import Path
import django
from django.contrib.auth import get_user_model
from django.core.management import call_command, execute_from_command_line
+from django.test.utils import ignore_warnings
DEFAULT_ENVS = {
"DJANGO_SETTINGS_MODULE": "pydis_site.settings",
@@ -154,7 +155,16 @@ class SiteManager:
def run_tests(self) -> None:
"""Prepare and run the test suite."""
self.prepare_environment()
- call_command(*sys.argv[1:])
+ # The whitenoise package expects a staticfiles directory to exist during startup,
+ # else it raises a warning. This is fine under normal application, but during
+ # tests, staticfiles are not, and do not need to be generated.
+ # The following line suppresses the warning.
+ # Reference: https://github.com/evansd/whitenoise/issues/215
+ with ignore_warnings(
+ message=r"No directory at: .*staticfiles",
+ module="whitenoise.base",
+ ):
+ call_command(*sys.argv[1:])
def clean_up_static_files(build_folder: Path) -> None: