Now we have created our test, we need to run it. Fortunately, this is very easy to do, jump into your terminal and type:
python manage.py test books
After a moment, Django should print out something like this:
Creating test database for alias 'default'... F ====================================================================== FAIL: test_recent_pub (books.tests.BookMethodTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:\Users\Nigel\ ... mysite\books\tests.py", line 25, in test_recent_pub self.assertEqual(future_pub.recent_publication(), False) AssertionError: True != False ---------------------------------------------------------------------- Ran 1 test in 0.000s FAILED (failures=1) Destroying test database for alias 'default'...
What happened is this:
Python
manage.py test books
looked for tests in the...