OpenSlides/openslides/utils/test.py
Norman Jäckel e1b149cde3 New config app. Apps only have to define config vars once. Config pages, forms and so on are created automaticly.
Changes after some reviews are done.

Problematic is still that the JS can not be moved to an extra file because of the template tags in the code.
2013-03-28 15:31:13 +01:00

30 lines
802 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.utils.test
~~~~~~~~~~~~~~~~~~~~~
Unit test class.
:copyright: 2011-2013 by OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from django.test import TestCase as _TestCase
from openslides.core.signals import post_database_setup
from openslides.config.api import config
class TestCase(_TestCase):
"""
Overwrites Django's TestCase class to call the post_database_setup
signal after the preparation of every test. Also refreshs the config cache.
"""
def _pre_setup(self, *args, **kwargs):
return_value = super(TestCase, self)._pre_setup(*args, **kwargs)
post_database_setup.send(sender=self)
config.setup_cache()
return return_value