mirror of
https://github.com/TrentSPalmer/trentpalmerdotorg.git
synced 2024-11-22 01:21:30 -08:00
update audio/tests/test_confirm_delete_episode_view.py add function
test_confirm_delete_episode_view_wrong_user()
This commit is contained in:
parent
eff4414291
commit
047e2c4392
@ -9,6 +9,19 @@ class TestConfirmDeleteEpisodeViewTestCase(TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
set_up()
|
set_up()
|
||||||
|
|
||||||
|
def test_confirm_delete_episode_view_wrong_user(self):
|
||||||
|
episode_a = Episode.objects.get(title="Mark Twain The Bee")
|
||||||
|
self.client.login(username='user_a', password='password_user_a')
|
||||||
|
kw_args = {'pk': episode_a.pk}
|
||||||
|
response = self.client.post(
|
||||||
|
reverse('audio:confirm_delete_episode', kwargs=kw_args),
|
||||||
|
follow=True)
|
||||||
|
self.assertEquals(response.status_code, 200)
|
||||||
|
self.assertTemplateUsed(response, 'audio/index.html')
|
||||||
|
qs = Episode.objects.filter(title="Mark Twain The Bee")
|
||||||
|
self.assertEquals(len(qs), 1)
|
||||||
|
self.assertEquals(response.request['PATH_INFO'], '/')
|
||||||
|
|
||||||
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')
|
||||||
|
Loading…
Reference in New Issue
Block a user