Files
deb-python-django-pyscss/tests/utils.py
Rocky Meza ae411e0b97 Automatically call collectstatic in tests.
It was very easy to have tests fail because of stale static files.
2014-02-03 17:16:29 -07:00

17 lines
468 B
Python

from django.test import TestCase
from django.core.management import call_command
class CollectStaticTestCase(TestCase):
def setUp(self):
call_command('collectstatic', interactive=False)
super(CollectStaticTestCase, self).setUp()
def clean_css(string):
# The output of the compiled CSS doesn't have a newline between the ; and
# the } for some reason.
return string.strip() \
.replace('\n', '') \
.replace('; ', ';')