def test_upcoming_recordings(self): p = Programme.query.get(1) schedule = Schedule(p.title, 'specification', p.start_time, p.channel) schedule.add(True) self.app.post('/api/schedules/reload') ## Force reload of upcoming recordings json_response = self._get_for_json('/api/upcoming_recordings') assert len(json_response) == 1
def test_schedules(self): assert len(pvr.db.session.query(Schedule).all()) == 0 json_response = self._get_for_json('/api/schedules') assert len(json_response) == 0 p = Programme.query.get(2) schedule = Schedule(p.title, 'specification', datetime.now(), Channel.query.get(1)) schedule.add(True) json_response = self._get_for_json('/api/schedules') assert len(json_response) == 1 assert json_response[0]['title'] == schedule.title assert json_response[0]['channel']['id'] == 1