I have a set of unit tests that I can successfully run with: ./runtests.py wagtail.wagtailcore.tests
I can also run:
./runtests.py wagtail.wagtailcore.tests.test_page_privacy
But if I want to execute just one of them, I get an error that 'module' object has no attribute [test_case_name]
My class would be something like:
class TestPagePrivacy(TestCase):
def test_anonymous_user_must_authenticate(self):
so I would think you could just say: ./runtests.py wagtail.wagtailcore.tests.test_page_privacy.test_anonymous_user_must_authenticate
Why doesn't this work?
From the django docs:
https://docs.djangoproject.com/en/1.11/topics/testing/overview/#running-tests
# Run just one test method
$ ./manage.py test animals.tests.AnimalTestCase.test_animals_can_speak
Looks like the answer is:
./runtests.py wagtail.wagtailcore.tests.test_page_privacy.TestPagePrivacy.test_anonymous_user_must_authenticate
So - directory / file name / class name / test name
你有没有尝试过
wagtail.wagtailcore.tests.TestPagePrivacy.test_anonymous_user_must_authenticate
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.