Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



This 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-...

For full-stack tests, you can use something like Splinter (http://splinter.cobrateam.info/).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: