def delete_episode(req, serie, episode): if serie and episode: s = Serie.get_by(name=serie) e = Episode.get_by(serie=s, name=episode) s.episodes.remove(e) session.commit() return Redirect(full_path_redirect(req.ENV, "/series/edit/%s" % serie))
def test_next_episode_invalid_episode_name(self): e = Episode(serie=Serie(name="dexter"), name="s01eab") self.assertEquals(None, e.next())
def test_next_episode(self): e = Episode(serie=Serie(name="dexter"), name="s01e08") self.assertEquals("s01e09", e.next().name) self.assertEquals("dexter", e.next().serie.name)