Remove test 404 and 500 paths outside dev
This commit is contained in:
parent
8844aad247
commit
8f66feeaa5
4 changed files with 13 additions and 3 deletions
|
@ -64,6 +64,7 @@ test_python:
|
||||||
variables:
|
variables:
|
||||||
POSTGRES_HOST_AUTH_METHOD: trust
|
POSTGRES_HOST_AUTH_METHOD: trust
|
||||||
DATABASE_URL: postgres://postgres@postgres/postgres
|
DATABASE_URL: postgres://postgres@postgres/postgres
|
||||||
|
TEST: "true"
|
||||||
script:
|
script:
|
||||||
- apt-get update && apt-get install --yes git libpq-dev
|
- apt-get update && apt-get install --yes git libpq-dev
|
||||||
- ./manage.py collectstatic --noinput --clear
|
- ./manage.py collectstatic --noinput --clear
|
||||||
|
|
2
justfile
2
justfile
|
@ -24,7 +24,7 @@ build:
|
||||||
pip {{ ARGS }}
|
pip {{ ARGS }}
|
||||||
|
|
||||||
test *ARGS:
|
test *ARGS:
|
||||||
./manage.py test {{ ARGS }}
|
TEST=true ./manage.py test {{ ARGS }}
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
coverage run ./manage.py test --keepdb
|
coverage run ./manage.py test --keepdb
|
||||||
|
|
|
@ -12,12 +12,14 @@ env = environ.Env(
|
||||||
SPOTIFY_PROXY_HOST=(str, ""),
|
SPOTIFY_PROXY_HOST=(str, ""),
|
||||||
SEO_INDEX=(bool, False),
|
SEO_INDEX=(bool, False),
|
||||||
SENTRY_DSN=(str, ""),
|
SENTRY_DSN=(str, ""),
|
||||||
|
TEST=(bool, False),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Read local secrets
|
# Read local secrets
|
||||||
environ.Env.read_env(BASE_DIR / ".env")
|
environ.Env.read_env(BASE_DIR / ".env")
|
||||||
|
|
||||||
DEBUG = env("DEBUG")
|
DEBUG = env("DEBUG")
|
||||||
|
TEST = env("TEST")
|
||||||
|
|
||||||
SECRET_KEY = env("SECRET_KEY")
|
SECRET_KEY = env("SECRET_KEY")
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,6 @@ urlpatterns = [
|
||||||
KeybaseView.as_view(),
|
KeybaseView.as_view(),
|
||||||
name="keybase",
|
name="keybase",
|
||||||
),
|
),
|
||||||
path("404/", page_not_found, name="404"),
|
|
||||||
path("500/", server_error, name="500"),
|
|
||||||
path("feed/", AllPagesFeed(), name="feed"),
|
path("feed/", AllPagesFeed(), name="feed"),
|
||||||
path(".health/", include("health_check.urls")),
|
path(".health/", include("health_check.urls")),
|
||||||
path("", include("website.legacy.urls")),
|
path("", include("website.legacy.urls")),
|
||||||
|
@ -67,6 +65,15 @@ if settings.DEBUG:
|
||||||
# Add django-debug-toolbar
|
# Add django-debug-toolbar
|
||||||
urlpatterns.append(path("__debug__/", include("debug_toolbar.urls")))
|
urlpatterns.append(path("__debug__/", include("debug_toolbar.urls")))
|
||||||
|
|
||||||
|
|
||||||
|
if settings.DEBUG or settings.TEST:
|
||||||
|
urlpatterns.extend(
|
||||||
|
[
|
||||||
|
path("404/", page_not_found, name="404"),
|
||||||
|
path("500/", server_error, name="500"),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
urlpatterns = urlpatterns + [
|
urlpatterns = urlpatterns + [
|
||||||
# For anything not caught by a more specific rule above, hand over to
|
# For anything not caught by a more specific rule above, hand over to
|
||||||
# Wagtail's page serving mechanism. This should be the last pattern in
|
# Wagtail's page serving mechanism. This should be the last pattern in
|
||||||
|
|
Loading…
Reference in a new issue