def test_get_playlists(self): ''' Test case to check if all playlists are returned by the get_playlists function ''' self.new_playlist.save_playlist() test_playlist = Playlist(name="The Production List") test_playlist.save_playlist() gotten_playlists = Playlist.get_playlists() self.assertTrue(len(gotten_playlists) == len(Playlist.query.all()))
def test_delete_playlist(self): ''' Test case to check if test_playlist is deleted from the database ''' self.new_playlist.save_playlist() test_playlist = Playlist(name="The Bose List") test_playlist.save_playlist() test_playlist.delete_playlist(test_playlist.id) gotten_playlists = Playlist.get_playlists() self.assertTrue(len(gotten_playlists) == len(Playlist.query.all()))