from django.core.urlresolvers import reverse
from django.test import TestCase

from ansible.models import Playbook


class PlaybookListViewTest(TestCase):
    fixtures = ['initial_data.json']

    def test_view_url_exists_at_desired_location(self):
        resp = self.client.get('/playbooks/')
        self.assertEqual(resp.status_code, 200)

    def test_view_playbook_list_url_accessible_by_name(self):
        resp = self.client.get(reverse('ansible:playbook-list'))
        self.assertEqual(resp.status_code, 200)

    def test_view_playbook_detail_url_accessible_by_name(self):
        resp = self.client.get(
            reverse('ansible:playbook-detail', kwargs={'pk':1})
        )
        self.assertEqual(resp.status_code, 200)

    def test_view_uses_correct_template(self):
        resp = self.client.get(reverse('ansible:playbook-list'))
        self.assertEqual(resp.status_code, 200)
        self.assertTemplateUsed(resp, 'ansible/playbook_list.html')

@@ -505,32 +505,212 @@
 tus_code, 200)%0A%0A
+    def test_view_playbook_list_has_create_playbook_link(self):%0A        resp = self.client.get(reverse('ansible:playbook-create'))%0A        self.assertEqual(resp.status_code, 200)%0A%0A
     def test_vie

Test to make sure link to create playbook exists