Skip to content

Instantly share code, notes, and snippets.

@polmuz
Created February 11, 2014 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polmuz/8944045 to your computer and use it in GitHub Desktop.
Save polmuz/8944045 to your computer and use it in GitHub Desktop.
Monkey patch django-assets to force using staticfiles during test runs
# WARNING!!
# This is a hack until there's a setting in django-assets
# to force using staticfiles finders and avoid the need
# to run collectstatics before each test run.
# Just put this in your test settings.
from django_assets.env import DjangoResolver
use_staticfiles = property(lambda self: True)
DjangoResolver.use_staticfiles = use_staticfiles
@Eagllus
Copy link

Eagllus commented Apr 28, 2014

Thank you for this!!
Been searching the either day to find something to make it work.

@kantord
Copy link

kantord commented May 20, 2014

Why not DjangoResolver.use_staticfiles = True?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment