Most Helpful Customer Reviews
3 of 3 people found the following review helpful:
5.0 out of 5 stars
Great book for anyone interested in testing their Django applications, May 16, 2010
This review is from: Django 1.1 Testing and Debugging (Paperback)
Once again I felt completely absorbed by the style chosen for this Packt Publishing book, as it makes use of a complete application to reinforce all of the topics covered. You start with a brief explanation of the benefits of testing your code and immediately start building a market research application from scratch.
Every chapter is built on the previous one, covering topics such as doctests, unittests, and adding coverage information and reports via Ned Batchelder's coverage script. You also learn about using Django's ''django.test.Client module and Twill to perform web testing and make sure that what your users see in their web browser is valid content and what they expected.
I liked the fact that several chapters were dedicated to showing you how to properly debug, log, and understand the information collected by these methods. Also how to fix any issues that may come up during the development phase, as well as write tests to catch them! I have definitely learned several new ways to look at debug information that I will make sure to add to my arsenal. Some of the tools you'll learn include the awesome Django Debug Toolbar (I wrote about it here) and even the Python debugger (pdb), so if you've never heard of either one or need a refresher, you'll enjoy the last chapters of this book.
By the time you're done reading this book, you'll have a complete market researching tool, including some Fancy Nancy charts generated by pygooglechart or matplotlib AND instructions on how to deploy it in a production environment and perform some load tests using siege!
Overall, this book offers good quality screenshots, clear and concise directions and working source code to follow along! I recommend it for anyone who's doing Django development out there and would like to improve the quality of their applications by adding (more) tests!
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
2 of 2 people found the following review helpful:
4.0 out of 5 stars
Good overview and introduction, June 6, 2010
This review is from: Django 1.1 Testing and Debugging (Paperback)
Packt Publishing sent me a copy of Django 1.1 Testing and Debugging for review. I was particularly interested in reading this title, as testing is something I know makes my code better, but don't feel like I do enough of, and because I work on a couple of Django-based projects in my spare time, with varying degrees of test coverage. While I consider myself comfortable with Python's stock unittest and doctest modules, I was curious to learn about how you can integrate Django with other Python testing tools.
Django 1.1. Testing and Debugging is split, as the title implies, into two halves: Testing, followed by Debugging. It uses a narrative approach, following the development of a survey application throughout. The book starts with an overview of the stock unittest and doctest facilities in Python. Most of chapters 1 through 3 are devoted to the basics of unit testing, specifically for Model classes. Tracey provides information about Django-specific nuances along with way. For example, I didn't realize Django ships with a customized doctest module to enabled ELLIPSES support in Python 2.3. Chapter 3 also provides information about how to use fixtures for providing test data, and how to specify those apart from the initial data fixtures developers may already be aware of. Chapter 4 mirrors some of the information found in Django's testing documentation: the Django TestCase, and how you use it to do basic view testing.
Chapter 5 describes integrating Django with other tools, primarily by example. Tracey discusses how to replace the default Django test runner, and what interface the replacement needs to implement. She also provides a stub example of more "invasive" integration, crafting a new management command that could (possibly) handle code coverage reporting while running the tests. This stub was interesting, but didn't feel particularly testing related to me. Chapter 5 closes with examples of using the excellent coverage package with django-coverage, and integrating twill into Django tests.
Chapter 6 begins the section on debugging with an overview of the Django settings that impact debugging, and how the development server supports debugging of applications. Chapter 7 follows with a thorough analysis of the development server's error page, as well as examples of debugging based on the information given. The examples continue to develop the survey application, and introduces what Tracey describes as "typical mistakes", then describes how to fix them.
Chapter 8 begins to dig a little deeper, and I was happy to see mention of Rob Hudson's Django Debug Toolbar, an indispensable tool. Chapter 8 also includes details on using the logging module, and how to develop a decorator that marks function entry and exit. I know that I'm all too guilty of using print instead of logging, and it was nice to be reminded of how easy this is.
Chapter 9 was my favorite part of the book. It gives a good overview of using pdb, and then goes on to demonstrate how to use pdb and a shell session to test a race condition and deal with it.
Overall Django 1.1 Testing and Debugging seems like a good introductory book for Django developers who are new to testing (or Django). While many of the debugging examples seemed obvious to me, I suspect that someone new to Django could use this book as an introduction to development and debugging.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
2 of 2 people found the following review helpful:
5.0 out of 5 stars
Great book, recommended, May 28, 2010
This review is from: Django 1.1 Testing and Debugging (Paperback)
This book is nothing if not ambitious. Weighing in at over 400 pages, it aims to highlight the development of an entire web app, start to finish, with a particular emphasis on the testing and debugging tools that Django provides.
Starting with the fundamentals of doctests and unit tests, the book also discusses what should be tested - not just how. And in doing this, the book reveals its target audience. I would particularly recommend this book for the following groups of people: developers who are relatively new to Django, and developers who are new to MVC frameworks in general.
The book then moves on to describe some of the tools you can use to extend Django's testing and debugging capabilities - the django-debug-toolbar, and Twill to name two.
A detailed discussion of Django error pages comes next, before what was, for me, the highlight of the book: an examination of PDB - the Python Debugger. If, like me, your initial exposure to Python came through Django, then you might well have missed some of the gems that the standard library contains, such as PDB. The book contains a detailed walkthrough of how to use PDB, and if you haven't used it before, well, you'll love it.
The book ends with a chapter on deployment, even including a section on load testing. Advanced topics such as testing threading issues are covered here too, ensuring that even seasoned Django developers will learn something from this book.
The book's greatest strength is its breadth - covering the entire development process from start to finish. If there's one flaw though, it is that it goes into a little too much detail in places. Like Juho, I could have done without the section on reporting bugs in Django.
You shouldn't let that put you off though - if the worst criticism I can muster is 'too much detail', that has to be a good thing! In particular, if you want to learn how to test your Django applications properly, or are new to Django and want to see the testing and debugging tools on offer, I would wholeheartedly recommend this book.
Help other customers find the most helpful reviews
Was this review helpful to you? Yes
No
|