diff options
| author | Aymeric Augustin | 2013-11-01 21:51:37 +0100 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-11-01 21:51:37 +0100 | 
| commit | 96f1cb4b0d4b10903502e917ddaa460bc05f5ca3 (patch) | |
| tree | 2d72e912b523f498f7e1c82aad362d5e6a58f396 /tests/base.py | |
| parent | f69f51f7abf25aaf5282c953475e8975694f41c1 (diff) | |
| download | django-debug-toolbar-96f1cb4b0d4b10903502e917ddaa460bc05f5ca3.tar.bz2 | |
Split tests across several modules.
Fix #426.
Diffstat (limited to 'tests/base.py')
| -rw-r--r-- | tests/base.py | 26 | 
1 files changed, 26 insertions, 0 deletions
| diff --git a/tests/base.py b/tests/base.py new file mode 100644 index 0000000..e6f6dac --- /dev/null +++ b/tests/base.py @@ -0,0 +1,26 @@ +from __future__ import unicode_literals + +import threading + +from django.http import HttpResponse +from django.test import TestCase, RequestFactory + +from debug_toolbar.middleware import DebugToolbarMiddleware +from debug_toolbar.toolbar.loader import DebugToolbar + +rf = RequestFactory() + + +class BaseTestCase(TestCase): + +    def setUp(self): +        request = rf.get('/') +        response = HttpResponse() +        toolbar = DebugToolbar(request) + +        DebugToolbarMiddleware.debug_toolbars[threading.current_thread().ident] = toolbar + +        self.request = request +        self.response = response +        self.toolbar = toolbar +        self.toolbar.stats = {} | 
