update audio/tests/test_confirm_delete_episode_view.py add function

test_confirm_delete_episode_view_get()
This commit is contained in:
Trent Palmer 2021-04-22 20:02:07 -07:00
parent 047e2c4392
commit 95cb13a697

View File

@ -22,6 +22,22 @@ class TestConfirmDeleteEpisodeViewTestCase(TestCase):
self.assertEquals(len(qs), 1) self.assertEquals(len(qs), 1)
self.assertEquals(response.request['PATH_INFO'], '/') self.assertEquals(response.request['PATH_INFO'], '/')
def test_confirm_delete_episode_view_get(self):
episode_a = Episode.objects.get(title="Mark Twain The Bee")
self.client.login(username='user_b', password='password_user_b')
kw_args = {'pk': episode_a.pk}
response = self.client.get(
reverse('audio:confirm_delete_episode', kwargs=kw_args),
follow=True)
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'audio/delete_episode_confirmation.html')
qs = Episode.objects.filter(title="Mark Twain The Bee")
self.assertEquals(len(qs), 1)
self.assertEquals(
response.request['PATH_INFO'],
f'/confirm-delete-episode/{episode_a.pk}'
)
def test_confirm_delete_episode_view(self): def test_confirm_delete_episode_view(self):
episode_a = Episode.objects.get(title="Mark Twain The Bee") episode_a = Episode.objects.get(title="Mark Twain The Bee")
self.client.login(username='user_b', password='password_user_b') self.client.login(username='user_b', password='password_user_b')