Python django.test.testcases.TestCase() Examples

The following are 2 code examples of django.test.testcases.TestCase(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.test.testcases , or try the search function .
Example #1
Source File: test_simple_testcase.py    From behave-django with MIT License 5 votes vote down vote up
def test_simple_test_runner_uses_simple_testcase(self):
        runner = mock.MagicMock()
        context = Context(runner)
        SimpleTestRunner().setup_testclass(context)
        assert isinstance(context.test, TestCase) 
Example #2
Source File: test.py    From Dailyfresh-B2C with Apache License 2.0 5 votes vote down vote up
def setUpClass(cls):
        # Get the module of the TestCase subclass
        cls._module = import_module(cls.__module__)
        cls._override = override_settings(ROOT_URLCONF=cls.__module__)

        if hasattr(cls._module, 'urlpatterns'):
            cls._module_urlpatterns = cls._module.urlpatterns

        cls._module.urlpatterns = cls.urlpatterns

        cls._override.enable()
        super(URLPatternsTestCase, cls).setUpClass()