def test_dj_playlist_creation(self): dj = create_dj() playlist = DJPlaylist(name='Best of Celine Dion', created_by_dj=dj) playlist.put() self.assertEqual(playlist.track_count, 0) self.assertEqual(playlist.established.timetuple()[0:4], datetime.datetime.now().timetuple()[0:4]) self.assertEqual(playlist.modified.timetuple()[0:4], datetime.datetime.now().timetuple()[0:4]) # just for sanity, not very good tests: self.assertEqual(playlist.established_display.timetuple()[0:2], datetime.datetime.now().timetuple()[0:2]) self.assertEqual(playlist.modified_display.timetuple()[0:2], datetime.datetime.now().timetuple()[0:2])
def test_dj_playlist_creation(self): dj = create_dj() playlist = DJPlaylist(name='Best of Celine Dion', created_by_dj=dj) playlist.put() self.assertEqual(playlist.track_count, 0) self.assertEqual( playlist.established.timetuple()[0:4], datetime.datetime.now().timetuple()[0:4]) self.assertEqual( playlist.modified.timetuple()[0:4], datetime.datetime.now().timetuple()[0:4]) # just for sanity, not very good tests: self.assertEqual( playlist.established_display.timetuple()[0:2], datetime.datetime.now().timetuple()[0:2]) self.assertEqual( playlist.modified_display.timetuple()[0:2], datetime.datetime.now().timetuple()[0:2])
def make_playlist(): playlist = DJPlaylist(name='funk 45 collection', created_by_dj=not_a_dj) playlist.put()