#27715: [Tutorial - part 6.] Lack of saving created question into db
-------------------------------------+-------------------------------------
               Reporter:  Mesco      |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  1.10
  Documentation                      |       Keywords:  tutorial
               Severity:  Normal     |  documentation
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I've been wondering for few hours why view tests fails despite the fact,
 everything is done the way tutorial shows:
 https://docs.djangoproject.com/en/1.10/intro/tutorial05/

 New-created Question objects had not been saved in temporary test
 database.

 Now, polls/tests.py is starts from:
 {{{
 def create_question(question_text, days):
     time = timezone.now() + datetime.timedelta(days=days)
     return Question.objects.create(question_text=question_text,
 pub_date=time)
 }}}

 For me works just:
 {{{
 def create_question(question_text, days):
     time = timezone.now() + datetime.timedelta(days=days)
     q = Question.objects.create(question_text=question_text,
 pub_date=time)
     q.save()
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27715>
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/054.76c6f35c9efd9c329b0a0d401c6ae060%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to