From c687915423265341d4a16494076b56679af09fb7 Mon Sep 17 00:00:00 2001 From: Harry Date: Thu, 27 Sep 2012 20:04:02 +0100 Subject: [PATCH] incorporate more of shannon's feedback. great! --- tdd-feedback.txt | 7 ++----- tutorial01.rst | 4 ++-- tutorial02.rst | 6 +++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tdd-feedback.txt b/tdd-feedback.txt index 50fb8f7..3a77aaf 100755 --- a/tdd-feedback.txt +++ b/tdd-feedback.txt @@ -53,18 +53,15 @@ General: Part 1 - don't like the "yes, we really meant it" explanation of INSTALLED_APPS. Prefer something like the "enabled" language in https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps - - `Ran 323 tests in 2.402s` before "Hooray! The joy of unbroken..." should say `Ran 1 test in ...s` - "It's OK to ignore these for now - we'll deal with templates for 500 errors in a later tutorial." ... i didn't find that later tutorial, but nominate Part 3 - - reverse the order of the `Poll` and `admin` imports in `mysite/polls/admin.py` before "If you've done everything right, the polls app folder will look like this:" to match Part 2 and final codebase + Part 2 - i don't think the user was instructed to run syncdb for the new Poll model, at 'Now, when you click the link you should see a menu a bit like this.' The message, "Remember, you may need to syncdb..." comes late - you might want to explain why 'body' is redefined in the test after every click, for a novice user - + `https://github.com/hjwp/Test-Driven-Django-Tutorial/blob/master/fts/tests.py` link gives 404. Should be `https://github.com/hjwp/Test-Driven-Django-Tutorial/blob/master/mysite/fts/tests.py` - - grammar: "finally, check it's attributes have been saved" : "its" - - `Ran 326 tests in 2.745s` but it should be `Ran 4 tests ...s` - "Tune in next week" is not relevant language anymore, since it's already been released. + Part 3 - "Don't forget the import at the top!" - which one? TestCase, Poll? - "That should give us a folder structure like this:" shows a `fts/test_polls.py` (also referred to in stack trace in Part 2) that doesn't exist. Also, it doesn't show `polls/views.py`, which does diff --git a/tutorial01.rst b/tutorial01.rst index 101bbae..49b8a41 100644 --- a/tutorial01.rst +++ b/tutorial01.rst @@ -1034,7 +1034,7 @@ And run the tests again:: . ---------------------------------------------------------------------- - Ran 323 tests in 2.402s + Ran 1 tests in 0.402s OK @@ -1071,8 +1071,8 @@ three lines inside the polls app called, ``polls/admin.py``: .. sourcecode:: python :filename: mysite/polls/admin.py - from polls.models import Poll from django.contrib import admin + from polls.models import Poll admin.site.register(Poll) diff --git a/tutorial02.rst b/tutorial02.rst index 84fb393..ca430d6 100644 --- a/tutorial02.rst +++ b/tutorial02.rst @@ -188,7 +188,7 @@ let's call that the end of our FT - you can get rid of the ``self.fail``. That's it for now - if you've lost track in amongst all the copy & pasting, you can compare your version to mine, which is hosted here: -https://github.com/hjwp/Test-Driven-Django-Tutorial/blob/master/fts/tests.py +https://github.com/hjwp/Test-Driven-Django-Tutorial/blob/master/mysite/fts/tests.py` Human-readable names for models and their attributes @@ -451,7 +451,7 @@ And let's do a unit test run:: AttributeError: 'Choice' object has no attribute 'save' ---------------------------------------------------------------------- - Ran 326 tests in 2.745s + Ran 4 tests in 0.745s FAILED (errors=1) @@ -595,7 +595,7 @@ server using ``manage.py runserver`` and check for yourself? Remember, you may need to ``syncdb``... Alternatively you can add a ``time.sleep(10)`` to the FT just before the error, and that will let you see what's happening) -Let's make 'votes' default to 0, by adding a new test in ``tests.py`` +Let's make 'votes' default to 0, by adding a new test in ``polls/tests.py`` .. sourcecode:: python :filename: mysite/polls/tests.py