コード例 #1
0
ファイル: tests.py プロジェクト: namespacestd/videoo
 def test_get_popular_movies_min_5_stars(self):
     profile = Profile.create_new_user('testing1', '*****@*****.**', 'testing1', date.today())
     movie = Movie.get_details(11)
     Rating.set_rating_for_user(movie, 1, profile)
     movie = Movie.get_details(12)
     Rating.set_rating_for_user(movie, 2, profile)
     movie = Movie.get_details(13)
     Rating.set_rating_for_user(movie, 3, profile)
     movie = Movie.get_details(513)
     Rating.set_rating_for_user(movie, 4, profile)
     movie = Movie.get_details(5)
     Rating.set_rating_for_user(movie, 5, profile)
     # There should only be one result when getting movies with rating 5 or higher
     self.assertTrue(Movie.get_popular(min_rating=5)['total_items'] == 1)
コード例 #2
0
ファイル: tests.py プロジェクト: namespacestd/videoo
 def test_get_popular_movies_min_1_star(self):
     profile = Profile.create_new_user('testing1', '*****@*****.**', 'testing1', date.today())
     movie = Movie.get_details(11)
     Rating.set_rating_for_user(movie, 1, profile)
     movie = Movie.get_details(12)
     Rating.set_rating_for_user(movie, 2, profile)
     movie = Movie.get_details(13)
     Rating.set_rating_for_user(movie, 3, profile)
     movie = Movie.get_details(513)
     Rating.set_rating_for_user(movie, 4, profile)
     movie = Movie.get_details(5)
     Rating.set_rating_for_user(movie, 5, profile)
     # All 5 movies should show up as results when the minimum rating required for a movie to be 'popular' is a 1
     self.assertTrue(Movie.get_popular(min_rating=1)['total_items'] == 5)
コード例 #3
0
ファイル: tests.py プロジェクト: zackkitzmiller/videoo
 def test_get_popular_movies_min_5_stars(self):
     profile = Profile.create_new_user('testing1', '*****@*****.**',
                                       'testing1', date.today())
     movie = Movie.get_details(11)
     Rating.set_rating_for_user(movie, 1, profile)
     movie = Movie.get_details(12)
     Rating.set_rating_for_user(movie, 2, profile)
     movie = Movie.get_details(13)
     Rating.set_rating_for_user(movie, 3, profile)
     movie = Movie.get_details(513)
     Rating.set_rating_for_user(movie, 4, profile)
     movie = Movie.get_details(5)
     Rating.set_rating_for_user(movie, 5, profile)
     # There should only be one result when getting movies with rating 5 or higher
     self.assertTrue(Movie.get_popular(min_rating=5)['total_items'] == 1)
コード例 #4
0
ファイル: tests.py プロジェクト: zackkitzmiller/videoo
 def test_get_popular_movies_min_1_star(self):
     profile = Profile.create_new_user('testing1', '*****@*****.**',
                                       'testing1', date.today())
     movie = Movie.get_details(11)
     Rating.set_rating_for_user(movie, 1, profile)
     movie = Movie.get_details(12)
     Rating.set_rating_for_user(movie, 2, profile)
     movie = Movie.get_details(13)
     Rating.set_rating_for_user(movie, 3, profile)
     movie = Movie.get_details(513)
     Rating.set_rating_for_user(movie, 4, profile)
     movie = Movie.get_details(5)
     Rating.set_rating_for_user(movie, 5, profile)
     # All 5 movies should show up as results when the minimum rating required for a movie to be 'popular' is a 1
     self.assertTrue(Movie.get_popular(min_rating=1)['total_items'] == 5)
コード例 #5
0
ファイル: tests.py プロジェクト: namespacestd/videoo
 def test_get_overall_most_popular(self):
     profile = Profile.create_new_user('testing5', '*****@*****.**', 'testing5', date.today())
     movie = Movie.get_details(11)
     Rating.set_rating_for_user(movie,4,profile)
     movie = Movie.get_details(12)
     Rating.set_rating_for_user(movie,5,profile)
     movie = Movie.get_details(13)
     Rating.set_rating_for_user(movie,2,profile)
     results = Movie.get_popular(min_rating=3)
     self.assertTrue(results['total_items'] == 2)
コード例 #6
0
ファイル: tests.py プロジェクト: zackkitzmiller/videoo
 def test_get_overall_most_popular(self):
     profile = Profile.create_new_user('testing5', '*****@*****.**',
                                       'testing5', date.today())
     movie = Movie.get_details(11)
     Rating.set_rating_for_user(movie, 4, profile)
     movie = Movie.get_details(12)
     Rating.set_rating_for_user(movie, 5, profile)
     movie = Movie.get_details(13)
     Rating.set_rating_for_user(movie, 2, profile)
     results = Movie.get_popular(min_rating=3)
     self.assertTrue(results['total_items'] == 2)