feat: added cover image to pattern
This commit is contained in:
+15
@@ -18,3 +18,18 @@ def collected_static_files():
|
||||
with override_settings(STATIC_ROOT=static_root):
|
||||
call_command('collectstatic', interactive=False, verbosity=0)
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(scope='session', autouse=True)
|
||||
def isolated_media_root():
|
||||
"""Los tests que suben imágenes (PatternImage, portada de Pattern...)
|
||||
escriben de verdad en MEDIA_ROOT; sin aislarlo, se acumulan en la
|
||||
carpeta media/ real del proyecto de una ejecución a otra, y como
|
||||
cover_image.py guarda cada variante con un nombre fijo (thumbnail.jpg,
|
||||
large.jpg) dentro de una carpeta por mes, esas sobras podían chocar con
|
||||
los nombres que espera un test concreto (ver
|
||||
PatternCoverImageUploadViewTests) y hacerlo fallar según lo que hubiera
|
||||
quedado de ejecuciones anteriores."""
|
||||
with tempfile.TemporaryDirectory() as media_root:
|
||||
with override_settings(MEDIA_ROOT=media_root):
|
||||
yield
|
||||
|
||||
Reference in New Issue
Block a user