Chapter 13. Validation at the Database Layer
Over the next few chapters weâll talk about testing and implementing validation of user inputs.
In terms of content, thereâs going to be quite a lot of material here thatâs more about the specifics of Django, and less discussion of TDD philosophy. That doesnât mean you wonât be learning anything about testingâthere are plenty of little testing tidbits in here, but perhaps itâs more about really getting into the swing of things, the rhythm of TDD, and how we get work done.
Once we get through these three short chapters, Iâve saved a bit of fun with JavaScript (!) for the end of Part II. Then itâs on to Part III, where I promise weâll get right back into some of the real nitty-gritty discussions in TDD methodologyâunit tests versus integrated tests, mocking, and more. Stay tuned!
But for now, a little validation. Letâs just remind ourselves where our FT is pointing us:
$ python3 manage.py test functional_tests.test_list_item_validation [...] ====================================================================== ERROR: test_cannot_add_empty_list_items (functional_tests.test_list_item_validation.ItemValidationTest) --------------------------------------------------------------------- Traceback (most recent call last): File "...python-tdd-book/functional_tests/test_list_item_validation.py", line 15, in test_cannot_add_empty_list_items self.wait_for(lambda: self.assertEqual( [...] File "...python-tdd-book/functional_tests/test_list_item_validation.py", ...
Get Test-Driven Development with Python, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.