Hi all;
OS Debian Linux KDE desktop
Django 1.9
Python 3.5
Working with tutorial
https://docs.djangoproject.com/en/1.9/intro/tutorial05/
Writing polls/tests.py script
I am consistently getting an error:
NameError: name 'create_question' is not defined.
The first section of tests.py to throw this error is:
def test_index_view_with_two_past_questions(self):
"""
The questions index page may display multiple questions.
"""
create_question(question_text="Past question 1.", days=-30)
create_question(question_text="Past question 2.", days=-5)
response = self.client.get(reverse('polls:index'))
self.assertQuerysetEqual(
response.context['latest_question_list'],
['<Question: Past question 2.>', '<Question: Past question
1.>']
)
The code example is in class QuestionMethodTests(TestCase): but is
flagged 8 times by the editor throughout the code in test.py. The same
error pops at run time.
The code seems to be identical to the code in the tutorial.
All of the errors occur on code lines like:
create_question(question_text=" .......
All help will be appreciated.
Gary R.