From fde3814fdf38cd1f9870ddd20eb9d1aa91f8d79b Mon Sep 17 00:00:00 2001 From: Andrews Medina Date: Wed, 5 Jun 2013 22:58:50 -0300 Subject: [PATCH] Added tests for example2 poll detail view. --- example2/polls/tests/test_views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/example2/polls/tests/test_views.py b/example2/polls/tests/test_views.py index 1e9f7dd..1847e49 100644 --- a/example2/polls/tests/test_views.py +++ b/example2/polls/tests/test_views.py @@ -52,3 +52,10 @@ class PollListTest(BaseIntegrationTest): params = {'action': 'DeleteSelectedAction'} response = self.client.post(reverse("admin2:polls_poll_index"), params, follow=True) self.assertContains(response, "Items must be selected in order to perform actions on them. No items have been changed.") + + +class PollDetailViewTest(BaseIntegrationTest): + def test_view_ok(self): + poll = Poll.objects.create(question="some question", pub_date=timezone.now()) + response = self.client.get(reverse("admin2:polls_poll_detail", args=(poll.pk, ))) + self.assertContains(response, poll.question)