diff --git a/audio/tests/test_confirm_delete_episode_view.py b/audio/tests/test_confirm_delete_episode_view.py index f75cfab..8c5a583 100644 --- a/audio/tests/test_confirm_delete_episode_view.py +++ b/audio/tests/test_confirm_delete_episode_view.py @@ -20,6 +20,10 @@ class TestConfirmDeleteEpisodeViewTestCase(TestCase): self.assertTemplateUsed(response, 'audio/index.html') qs = Episode.objects.filter(title="Mark Twain The Bee") self.assertEquals(len(qs), 0) + self.assertEquals( + response.request['PATH_INFO'], + f'/feed/{episode_a.feed.pk}/{episode_a.feed.slug}' + ) def test_confirm_delete_episode_view_no_login(self): episode_a = Episode.objects.get(title="Mark Twain The Bee") @@ -31,3 +35,4 @@ class TestConfirmDeleteEpisodeViewTestCase(TestCase): 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'], '/') diff --git a/audio/tests/test_confirm_delete_feed_view.py b/audio/tests/test_confirm_delete_feed_view.py index 12bb02b..210f999 100644 --- a/audio/tests/test_confirm_delete_feed_view.py +++ b/audio/tests/test_confirm_delete_feed_view.py @@ -24,6 +24,7 @@ class TestConfirmDeleteFeedViewTestCase(TestCase): self.assertEquals(len(qs), 0) qs = Episode.objects.filter(title="Mark Twain The Bee") self.assertEquals(len(qs), 0) + self.assertEquals(response.request['PATH_INFO'], '/feeds/') def test_confirm_delete_feed_view_no_login(self): feed_a = Feed.objects.get(title="Short Stories Mark Twain") @@ -39,3 +40,4 @@ class TestConfirmDeleteFeedViewTestCase(TestCase): self.assertEquals(len(qs), 1) qs = Episode.objects.filter(title="Mark Twain The Bee") self.assertEquals(len(qs), 1) + self.assertEquals(response.request['PATH_INFO'], '/') diff --git a/audio/tests/test_edit_episode_view.py b/audio/tests/test_edit_episode_view.py index 0d17cf4..a048ae7 100644 --- a/audio/tests/test_edit_episode_view.py +++ b/audio/tests/test_edit_episode_view.py @@ -37,6 +37,10 @@ class TestEditEpisodeViewTestCase(TestCase): ) self.assertEquals(episode_ab.image_license, 1) self.assertEquals(episode_ab.image_license_jurisdiction, "in the United States") + self.assertEquals( + response.request['PATH_INFO'], + f'/edit-episode/{episode_ab.pk}/{episode_ab.slug}' + ) def test_edit_episode_view_no_data(self): episode_a = Episode.objects.get(title="Mark Twain The Bee") @@ -47,6 +51,10 @@ class TestEditEpisodeViewTestCase(TestCase): self.assertEquals(response.status_code, 200) episode_ab = Episode.objects.get(title="Mark Twain The Bee") self.assertEquals(episode_ab.author, '') + self.assertEquals( + response.request['PATH_INFO'], + f'/edit-episode/{episode_ab.pk}/{episode_ab.slug}' + ) def test_edit_episode_view_no_login(self): episode_a = Episode.objects.get(title="Mark Twain The Bee") @@ -67,3 +75,4 @@ class TestEditEpisodeViewTestCase(TestCase): self.assertEquals(response.status_code, 200) episode_ab = Episode.objects.get(title="Mark Twain The Bee") self.assertEquals(episode_ab.author, "") + self.assertEquals(response.request['PATH_INFO'], '/') diff --git a/audio/tests/test_edit_feed_view.py b/audio/tests/test_edit_feed_view.py index ea8ca51..3520ed2 100644 --- a/audio/tests/test_edit_feed_view.py +++ b/audio/tests/test_edit_feed_view.py @@ -62,6 +62,10 @@ class TestEditFeedViewTestCase(TestCase): self.assertEquals(feed_a.license_url, "https://en.wikipedia.org/wiki/Public_domain") self.assertEquals(feed_a.license_name, 'Public Domain') self.assertEquals(feed_a.get_itpc_rss, f'itpc://{settings.DOMAIN_NAME}/rss/{feed_a.slug}.xml') + self.assertEquals( + response.request['PATH_INFO'], + f'/edit-feed/{feed_a.pk}/{feed_a.slug}' + ) def test_edit_feed_view_no_data(self): feed_c = Feed.objects.get(title="Short Stories Mark Twain") @@ -95,6 +99,10 @@ class TestEditFeedViewTestCase(TestCase): self.assertEquals(feed_a.license_url, "https://en.wikipedia.org/wiki/Public_domain") self.assertEquals(feed_a.license_name, 'Public Domain') self.assertEquals(feed_a.get_itpc_rss, f'itpc://{settings.DOMAIN_NAME}/rss/{feed_a.slug}.xml') + self.assertEquals( + response.request['PATH_INFO'], + f'/edit-feed/{feed_a.pk}/{feed_a.slug}' + ) def test_edit_feed_view(self): feed_c = Feed.objects.get(title="Short Stories Mark Twain") @@ -149,3 +157,7 @@ class TestEditFeedViewTestCase(TestCase): self.assertEquals(feed_a.license_url, "https://en.wikipedia.org/wiki/Public_domain") self.assertEquals(feed_a.license_name, 'Public Domain') self.assertEquals(feed_a.get_itpc_rss, f'itpc://{settings.DOMAIN_NAME}/rss/{feed_a.slug}.xml') + self.assertEquals( + response.request['PATH_INFO'], + f'/edit-feed/{feed_a.pk}/{feed_a.slug}' + ) diff --git a/audio/tests/test_new_episode_view.py b/audio/tests/test_new_episode_view.py index 922985e..8f553b6 100644 --- a/audio/tests/test_new_episode_view.py +++ b/audio/tests/test_new_episode_view.py @@ -20,6 +20,10 @@ class TestNewEpisodeViewTestCase(TestCase): self.assertEquals(response.status_code, 200) qs = Episode.objects.filter(title="Mark Twain Taming The Bicycle") self.assertEquals(len(qs), 0) + self.assertEquals( + response.request['PATH_INFO'], + f'/new-episode/{feed_a.pk}/{feed_a.slug}' + ) def test_new_episode_view_no_login(self): feed_a = Feed.objects.get(title="Short Stories Mark Twain") @@ -48,6 +52,7 @@ class TestNewEpisodeViewTestCase(TestCase): self.assertEquals(response.status_code, 200) qs = Episode.objects.filter(title="Mark Twain Taming The Bicycle") self.assertEquals(len(qs), 0) + self.assertEquals(response.request['PATH_INFO'], '/') def test_new_episode_view(self): feed_a = Feed.objects.get(title="Short Stories Mark Twain") @@ -99,3 +104,7 @@ class TestNewEpisodeViewTestCase(TestCase): ) self.assertEquals(episode_a.user, user_b) self.assertEquals(episode_a.feed, feed_a) + self.assertEquals( + response.request['PATH_INFO'], + f'/new-episode/{feed_a.pk}/{feed_a.slug}' + ) diff --git a/audio/tests/test_new_feed_view.py b/audio/tests/test_new_feed_view.py index a54d676..dc34fae 100644 --- a/audio/tests/test_new_feed_view.py +++ b/audio/tests/test_new_feed_view.py @@ -32,6 +32,7 @@ class TestNewFeedViewTestCase(TestCase): self.assertTemplateUsed(response, 'base_form.html') qs = Feed.objects.filter(title="Short Stories Mark Twain") self.assertEquals(len(qs), 0) + self.assertEquals(response.request['PATH_INFO'], '/new-feed/') def test_new_feed_view_no_login(self): with open('bicycle.jpg', 'rb') as image_f: @@ -60,6 +61,7 @@ class TestNewFeedViewTestCase(TestCase): self.assertTemplateUsed(response, 'audio/index.html') qs = Feed.objects.filter(title="Short Stories Mark Twain") self.assertEquals(len(qs), 0) + self.assertEquals(response.request['PATH_INFO'], '/') def test_new_feed_view(self): self.client.login(username='user_b', password='password_user_b') @@ -112,3 +114,4 @@ class TestNewFeedViewTestCase(TestCase): self.assertEquals(feed_a.license_url, "https://en.wikipedia.org/wiki/Public_domain") self.assertEquals(feed_a.license_name, 'Public Domain') self.assertEquals(feed_a.get_itpc_rss, f'itpc://{settings.DOMAIN_NAME}/rss/{feed_a.slug}.xml') + self.assertEquals(response.request['PATH_INFO'], '/new-feed/') diff --git a/audio/tests/test_views.py b/audio/tests/test_views.py index 0ecc602..da3dd7c 100644 --- a/audio/tests/test_views.py +++ b/audio/tests/test_views.py @@ -53,6 +53,7 @@ class TestViewsTestCase(TestCase): response = self.client.get(reverse('audio:home')) self.assertEquals(response.status_code, 200) self.assertTemplateUsed(response, 'audio/index.html') + self.assertEquals(response.request['PATH_INFO'], '/') def test_feed_view(self): feed_a = Feed.objects.get(title="Short Stories Mark Twain") @@ -60,6 +61,10 @@ class TestViewsTestCase(TestCase): response = self.client.get(reverse('audio:feed', kwargs=kw_args)) self.assertEquals(response.status_code, 200) self.assertTemplateUsed(response, 'audio/index.html') + self.assertEquals( + response.request['PATH_INFO'], + f'/feed/{feed_a.pk}/{feed_a.slug}' + ) def test_episode_view(self): episode_a = Episode.objects.get(title='Mark Twain The Bee') @@ -67,8 +72,13 @@ class TestViewsTestCase(TestCase): response = self.client.get(reverse('audio:episode', kwargs=kw_args)) self.assertEquals(response.status_code, 200) self.assertTemplateUsed(response, 'audio/index.html') + self.assertEquals( + response.request['PATH_INFO'], + f'/episode/{episode_a.pk}/{episode_a.slug}' + ) def test_feeds_view(self): response = self.client.get(reverse('audio:feeds')) self.assertEquals(response.status_code, 200) self.assertTemplateUsed(response, 'audio/feeds.html') + self.assertEquals(response.request['PATH_INFO'], '/feeds/')