I think the trick is in the name of the module and/or test case. I can't remember exactly how django-nose modifies test discovery but here's what nose does alone:
Try renaming the test class to something that begins with "Test" -- so like "TestAccounts" and then use "test_something", "test_something_else" types of names for methods. I think that this should work.
If all else fails, you can always point to the module directly:
./manage.py test myproject.accounts.tests.test_account.AccountTest
You may also try adding '--all-modules' to NOSE_ARGS in your project settings:
NOSE_ARGS = [
...
'--all-modules'
]
or by passing "--all-modules" directly to ./manage.py:
./manage.py test --all-modules
Hope this helps.
--Evan
On Monday, December 31, 2012 9:41:33 AM UTC-8, Joe Legner wrote:
I am trying to get django_nose to discover tests in my project. I watched this video which seems to indicate that my project/app/tests/__init__.py should be able to be empty (not contain a bunch of import * statements):
The goal is to have django_nose find my tests by name so I do not have to have import * from ... statements within my tests/__init__.py for every app. My project is set up like this:
/myproject
/accounts
__init__.py
/tests
__init__.py
test_account.py
The __init__.py file is empty. The test_account.py file contains an AccountTest class derived from unittest.TestCase.
When I run ./manage.py test accounts (with an empty __init__.py), the result is "Ran 0 tests in 0.000s"
Now, if I make accounts/tests/__init__.py contain the line from test_account import *, it works correctly; therefore, I believe I do have django_nose (version 1.1 and nose 1.2.1) installed and working.
I Googled all morning to solve the problem but have failed. If you have any insight, please reply. Thank you.