Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#28429 closed Bug (invalid)

Doc error

Reported by: xylle Owned by: nobody
Component: Documentation Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (2)

comment:1 by Tim Graham, 7 years ago

Resolution: invalid
Status: newclosed

I'm not sure what the issue is but there isn't a documentation error there. See TicketClosingReasons/UseSupportChannels for ways to get help debugging your problem.

comment:2 by xylle, 7 years ago

I did what the documentation says, but it did not do what it should.
The documentation is really well done, it's a shame that at this point, it does not do what is expected.

I do not want any help to debug, I found a solution on my own, just point out a potential problem.

Last edited 7 years ago by xylle (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top