mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-13 16:34:52 +03:00
Customise MEDIA_URL setting instead of using fixture
This commit is contained in:
parent
f3909e6e80
commit
5e11a8f1fd
|
@ -29,6 +29,11 @@ EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa: F405
|
TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa: F405
|
||||||
|
|
||||||
|
# MEDIA
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# https://docs.djangoproject.com/en/dev/ref/settings/#media-url
|
||||||
|
MEDIA_URL = 'http://media.testserver'
|
||||||
|
|
||||||
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
|
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
|
||||||
# django-webpack-loader
|
# django-webpack-loader
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
|
@ -9,11 +9,6 @@ def media_storage(settings, tmpdir):
|
||||||
settings.MEDIA_ROOT = tmpdir.strpath
|
settings.MEDIA_ROOT = tmpdir.strpath
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
|
||||||
def media_url(settings):
|
|
||||||
settings.MEDIA_URL = 'http://testserver'
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def user(db) -> User:
|
def user(db) -> User:
|
||||||
return UserFactory()
|
return UserFactory()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user