text: from django.test import TestCase
  from django.urls import reverse
  
  from apps.polls.tests.test_utils import create_question
  
  
  class QuestionDetailViewTests(TestCase):
      def test_future_question(self):
          """
          The detail view of a question with a pub_date in the future
          returns a 404 not found.
          """
          future_question = create_question(question_text='Future question.', days=5)
          url = reverse('polls:detail', args=(future_question.id,))
          response = self.client.get(url)
          self.assertEqual(response.status_code, 404)
  
      def test_past_question(self):
          """
          The detail view of a question with a pub_date in the past
          displays the question's text.
          """
          past_question = create_question(question_text='Past Question.', days=-5)
          url = reverse('polls:detail', args=(past_question.id,))
          response = self.client.get(url)
          self.assertContains(response, past_question.question_text)
  