1 from couchdbkit
.ext
.django
.testrunner
import CouchDbKitTestSuiteRunner
3 from django
.conf
import settings
7 # http://djangosnippets.org/snippets/2211/
9 class MygpoTestSuiteRunner(CouchDbKitTestSuiteRunner
):
11 Test runner that is able to skip some tests according to settings.py
14 def __init__(self
, *args
, **kwargs
):
15 self
.EXCLUDED_APPS
= getattr(settings
, 'TEST_EXCLUDE', [])
16 settings
.TESTING
= True
17 super(MygpoTestSuiteRunner
, self
).__init
__(*args
, **kwargs
)
20 def build_suite(self
, *args
, **kwargs
):
21 suite
= super(MygpoTestSuiteRunner
, self
).build_suite(*args
, **kwargs
)
22 if not args
[0] and not getattr(settings
, 'RUN_ALL_TESTS', False):
25 pkg
= case
.__class
__.__module
__.split('.')[0]
26 if pkg
not in self
.EXCLUDED_APPS
:
32 def create_auth_string(username
, password
):
34 credentials
= base64
.encodestring("%s:%s" % (username
, password
)).rstrip()
35 auth_string
= 'Basic %s' % credentials