Exemplo n.º 1
0
 def setUp(self):
     self.videolist = []
     self.SHA1 = 'AABBCC2'
     self.db = mmodel() 
     self.video = video_model()
     self.user = user_model()
     self.db.new_user('simsun', "www.soso.com")
     self.db.new_user('tyler', 'www.tyler.com')
     self.db.new_user('juncheng', 'www.juncheng.com')
     self.videolist.append(self.db.new_video('simsun', 'test123', self.SHA1, 'title1', 'spot1', url='/video/1.mp4'))
     self.videolist.append(self.db.new_video('simsun', 'video1', self.SHA1+'A', 'title2', 'spot2', url='/video/2.mp4'))
     self.videolist.append(self.db.new_video('simsun', 'video2', self.SHA1+'B', 'title3', 'spot3', url='/video/3.mp4'))
     self.videolist.append(self.db.new_video('simsun', 'video3', self.SHA1+'C', 'title4', 'spot5', url='/video/4.mp4'))
     self.videolist.append(self.db.new_video('juncheng', 'video1', self.SHA1+'D', 'title5', 'spot6', url='/video/5.mp4'))
     self.videolist.append(self.db.new_video('tyler', 'video', self.SHA1+'EF', 'title', 'spot1', url='/video/6.mp4'))
     self.videolist.append(self.db.new_video('tyler', 'video', self.SHA1+'F', 'title', 'spot2', url='/video/7.mp4'))
     self.videolist.append(self.db.new_video('tyler', 'video', self.SHA1+'Z', 'title', 'spot3',url='/video/1.mp4'))
     self.db.add_follow('simsun', 'tyler')
     self.db.add_follow('simsun', 'juncheng')
     
     self.db.like_video('tyler', '1')
     self.db.like_video('juncheng', '1')
Exemplo n.º 2
0
 def __init__(self):
     self.user  = user_model()
     self.video = video_model()