#28429: Doc error
-----------------------------------------+------------------------
Reporter: xylle | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Hello,
in the chapter "Writing your first Django app, part 5"
iI have problems with "Create a test to expose the bug"
If i use : "from .models import Question"
I have
{{{
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
FF
======================================================================
FAIL: test_was_published_recently_with_old_question
(polls.tests.QuestionModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/mysite/polls/tests.py", line 18, in
test_was_published_recently_with_old_question
self.assertIs(old_question.was_published_recently(), False)
AssertionError: None is not False
======================================================================
FAIL: test_was_published_recently_with_recent_question
(polls.tests.QuestionModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/srv/mysite/polls/tests.py", line 27, in
test_was_published_recently_with_recent_question
self.assertIs(recent_question.was_published_recently(), True)
AssertionError: None is not True
----------------------------------------------------------------------
Ran 2 tests in 0.002s
FAILED (failures=2)
Destroying test database for alias 'default'...
}}}
If i use : "from polls.models import Question"
I have
{{{
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
..
----------------------------------------------------------------------
Ran 2 tests in 0.002s
OK
Destroying test database for alias 'default'...
}}}
"from polls.models import Question" is correct or, I have an error
elsewhere?
PS
Django VERSION : (1, 11, 3, 'final', 0) installed by pip
OS : Debian Stretch 9
Python version : 3.5.3 installed by apt.
--
Ticket URL: <https://code.djangoproject.com/ticket/28429>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.75404a99413fd21309bdbae9c990c54d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.