The "create" method (as in Question.objects.create) saves the object to the database
On Thu, Oct 15, 2015 at 6:08 AM, Shun Liang <[email protected]> wrote: > Dear All, > > In the 5th part of the Django Tutorial ( > https://docs.djangoproject.com/en/1.8/intro/tutorial05/#testing-our-new-view > ), there is a helper function "create_question" in polls/test,py, which > creates a question instance and returns it. However the created question > instance does not seem to be saved anywhere in the code, so how does the > test client retrieves the right information from the views, as it should > not be in the DB if the save() method is never called? > > Best, > Shun > > -- > You received this message because you are subscribed to the Google Groups > "Django users" 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]. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/2b5afd33-be21-4092-b4d7-46d18cfbb652%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/2b5afd33-be21-4092-b4d7-46d18cfbb652%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" 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]. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei3%3Dqom9SBd10SjmUSwCowRvat-Roob%2Buo%2BuJJteME07bw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

