def test_keep_active_youtube_link(self): pondlife = Production.objects.get(title='Pondlife') link = pondlife.links.create( link_class='SpeccyWikiPage', parameter='ldoVS0idTBw', is_download_link=False ) ProductionLink.objects.filter(id=link.id).update( link_class='YoutubeVideo' ) clean_dead_youtube_link(link.id) self.assertEqual(pondlife.links.filter(link_class='YoutubeVideo').count(), 1)
def test_clean_dead_youtube_link(self): pondlife = Production.objects.get(title='Pondlife') link = pondlife.links.create( link_class='SpeccyWikiPage', parameter='404', is_download_link=False ) ProductionLink.objects.filter(id=link.id).update( link_class='YoutubeVideo' ) with captured_stdout(): clean_dead_youtube_link(link.id) self.assertEqual(pondlife.links.filter(link_class='YoutubeVideo').count(), 0)
def test_clean_dead_youtube_link_non_existent(self): # non-existent link clean_dead_youtube_link(9999)
def test_clean_dead_youtube_link_non_existent(self): pondlife = Production.objects.get(title='Pondlife') # non-existent link clean_dead_youtube_link(9999)