-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run tests only if using test settings. #12
base: master
Are you sure you want to change the base?
Conversation
I've actually added a separate test project so you can run the tests without needing your own project already set up. This seems to be the way several other 3rd party apps have gone. I'll definitely review when 1.4 lands though. |
OK, but tests should also not fail (can be skipped) if you run all tests available in a project. |
Hm, all tests are currently being skipped if I run them with a given test project. This is probably not a feature. ;-) |
Hah! That's what you get for coding with a baby in one arm! :) |
Congrats that it does run then! |
Actually - running What do you see when you run: python manage.py test -v2 ? |
OK. My mistake. It picked my old version of django-lazysignup. OK, so this testproject works. But django-lazysignup tests are still run if I run all tests for my project. And they fail. I would argue that they should succeed or be skipped. |
Yes, they should - though I don't like the idea of adding a setting to do it. Lazysignup already has its fair share! And I don't recall seeing that pattern used anywhere else. I think the proper fix is improve the test isolation from the settings being used. For example, I'm guessing that the failures you're seeing are 404s, as the test urls aren't used - I should be using the It's not as small a fix as your original pull request, but I feel it's the correct way. Does that sound reasonable? |
I am getting those failures:
Sadly, I doubt that |
Currently tests are always run. Now they are skipped if they are not run with test settings. This allows running tests for many applications at the same time (
./manage test
).Probably this can be improved once Django 1.4 lands as it supports custom settings for tests. (Although custom model probably has to be configured before test database is setup.)