python - Django - beginner tips for test writing? -
i django beginner , need learn how write functional , unit tests. going start documentation, maybe knows tutorials or has tips share? should use "selenium" functional tests or considered bad practise?
also wondering percentage of code should cover tests?
thanks answers in advance.
as resources, right after finish docs go straight book, it'll cover writing tests in django, simple complex tests:
http://www.obeythetestinggoat.com/
now code coverage, 1 basic thing you'll learn in book above test everything, quoting page 1 of book:
obey testing goat! nothing until have test
one great tool find useful while testing coverage of tests coverage.py, tell how of code covered tests, here's django docs it:
https://docs.djangoproject.com/en/dev/topics/testing/advanced/#integration-with-coverage-py
hope helps!
Comments
Post a Comment