myapp2.views: 6 total statements, 100.0% covered

Generated: Sat 2012-06-09 22:07 SGT

Source file: /Users/martin/Projects/pycon-apac-2012/tdd-with-django/reusable-app/myapp2/views.py

Stats: 4 executed, 0 missed, 2 excluded, 15 ignored

  1. """
  2. Views for the ``myapp2`` application.
  3. Before implementing anything here, you would first create
  4. ``tests/implementation_tests/views_tests.py`` and try to call this view via
  5. ``self.client.get``. Then you would do the "TDD Dance" and gradually follow
  6. the instructions the failing tests give you. You would add the view to the
  7. ``urls.py``, you would import the view in the ``urls.py``, you would finally
  8. implement the view in this file and then add the missing template.
  9. This is a great example how TDD will guide you during your implementation
  10. """
  11. from django.views.generic import TemplateView
  12. class HomeView(TemplateView):
  13. template_name = 'myapp2/home.html'
  14. def dispatch(self, *args, **kwargs):
  15. return super(HomeView, self).dispatch(*args, **kwargs)