4 ms·
What are the best practices for testing in Django? I feel silly testing my models. And testing my views also seems kind of awkward. But then there's nothing
by tocomment 15y ago
What are the best practices for testing in Django? I feel silly testing my models. And testing my views also seems kind of awkward. But then there's nothing else to test.
Any advice?
- numix 15y agoThis really depends on your situation. If you are writing a reusable app, then you probably want both unit tests and a sample project to run integration tests against. For testing a basic website, you'll probably want to test any custom managers or model methods, and your views. A good guide to getting started is here: http://toastdriven.com/blog/2011/apr/10/guide-to-testing-in-django/ http://toastdriven.com/blog/2011/apr/10/guide-to-testing-in-... For full-stack tests, you can use something like Splinter (http://splinter.cobrateam.info/ http://splinter.cobrateam.info/).