1๐
โ
I ended up writing down my own TestSuiteRunner, like @sneawo said.
After Django-style fails, try importing as usual python-style.
One line to fix:
suite.addTest(build_test(label))
into
try:
suite.addTest(django.test.simple.build_test(label))
except ValueError:
# change to python-style package name
head, tail = label.split('.', 1)
full_label = '.'.join([head, django.test.simple.TEST_MODULE, tail])
# load tests
tests = unittest.defaultTestLoader.loadTestsFromName(full_label)
suite.addTests(tests)
and set TEST_RUNNER
in settings.py
:
TEST_RUNNER='myapp.tests.module_test_suite_runner.ModuleTestSuiteRunner'
๐คJang-hwan Kim
1๐
I think to achieve this you need to subclass your own TestRunner from DjangoTestSuiteRunner and override build_suite
method.
๐คsneawo
- [Answered ]-How do I create and save dynamic fields in Django ModelAdmin?
- [Answered ]-Filtering dropdown queryset in Django view
- [Answered ]-Django CBV AttributeError: Generic detail view must be called with either an object pk or a slug
- [Answered ]-Django Admin panel not working with https
Source:stackexchange.com