def test_render_no_submission(self):
     q = Quiz.objects.create()
     question = Question.objects.create(
         quiz=q, text="a question", question_type='long text')
     u = User.objects.create(username="******")
     n = GetQuestionResponseNode('question', "foo")
     r = FakeRequest()
     r.user = u
     context = dict(request=r, question=question)
     out = n.render(context)
     self.assertEqual(out, '')
     self.assertFalse('foo' in context)
 def test_render(self):
     q = Quiz.objects.create()
     question = Question.objects.create(
         quiz=q, text="a question", question_type='long text')
     u = User.objects.create(username="******")
     submission = Submission.objects.create(
         quiz=q,
         user=u)
     response = Response.objects.create(
         submission=submission,
         question=question,
         value="a long text response")
     n = GetQuestionResponseNode('question', "foo")
     r = FakeRequest()
     r.user = u
     context = dict(request=r, question=question)
     out = n.render(context)
     self.assertEqual(out, '')
     self.assertTrue('foo' in context)
     self.assertEqual(context['foo'], response)