Beispiel #1
0
 def test_feature_page_filter(self):
     user1 = db_utils.create_user()
     folder = db_utils.create_folder(
         user1, settings=CharSettings({"featured-filter"}, {}, {}))
     db_utils.create_submissions(9, user1, ratings.GENERAL.code)
     db_utils.create_submission(user1, ratings.GENERAL.code, folderid=folder)
     self.assertEqual(
         10, len(submission.select_list(user1, ratings.GENERAL.code, 10)))
     self.assertEqual(
         1, len(submission.select_list(user1, ratings.GENERAL.code, 10,
                                       featured_filter=True)))
Beispiel #2
0
    def test_filters(self):
        # Test filters of the following:
        # userid, folderid, category, hidden
        user1 = db_utils.create_user()
        user2 = db_utils.create_user()
        folder = db_utils.create_folder(user1)
        db_utils.create_submission(user1, rating=ratings.GENERAL.code, folderid=folder)
        db_utils.create_submission(user1, rating=ratings.GENERAL.code, subtype=1010)
        db_utils.create_submission(user1, rating=ratings.GENERAL.code, settings=CharSettings({'hidden'}, {}, {}))
        db_utils.create_submission(user2, rating=ratings.GENERAL.code)

        self.assertEqual(3, len(submission.select_list(user1, ratings.EXPLICIT.code, 10)))
        self.assertEqual(1, len(submission.select_list(user1, ratings.EXPLICIT.code, 10, otherid=user2)))
        self.assertEqual(1, len(submission.select_list(user1, ratings.EXPLICIT.code, 10, folderid=folder)))
        self.assertEqual(1, len(submission.select_list(user1, ratings.EXPLICIT.code, 10, subcat=1010)))
Beispiel #3
0
 def test_feature_page_filter(self):
     user1 = db_utils.create_user()
     folder = db_utils.create_folder(user1,
                                     settings=CharSettings(
                                         {"featured-filter"}, {}, {}))
     db_utils.create_submissions(9, user1, ratings.GENERAL.code)
     db_utils.create_submission(user1,
                                ratings.GENERAL.code,
                                folderid=folder)
     self.assertEqual(
         10, len(submission.select_list(user1, ratings.GENERAL.code, 10)))
     self.assertEqual(
         1,
         len(
             submission.select_list(user1,
                                    ratings.GENERAL.code,
                                    10,
                                    featured_filter=True)))
Beispiel #4
0
    def test_filters(self):
        # Test filters of the following:
        # userid, folderid, category, hidden
        user1 = db_utils.create_user()
        user2 = db_utils.create_user()
        folder = db_utils.create_folder(user1)
        db_utils.create_submission(user1,
                                   rating=ratings.GENERAL.code,
                                   folderid=folder)
        db_utils.create_submission(user1,
                                   rating=ratings.GENERAL.code,
                                   subtype=1010)
        db_utils.create_submission(user1,
                                   rating=ratings.GENERAL.code,
                                   settings=CharSettings({'hidden'}, {}, {}))
        db_utils.create_submission(user2, rating=ratings.GENERAL.code)

        self.assertEqual(
            3, len(submission.select_list(user1, ratings.EXPLICIT.code, 10)))
        self.assertEqual(
            1,
            len(
                submission.select_list(user1,
                                       ratings.EXPLICIT.code,
                                       10,
                                       otherid=user2)))
        self.assertEqual(
            1,
            len(
                submission.select_list(user1,
                                       ratings.EXPLICIT.code,
                                       10,
                                       folderid=folder)))
        self.assertEqual(
            1,
            len(
                submission.select_list(user1,
                                       ratings.EXPLICIT.code,
                                       10,
                                       subcat=1010)))
Beispiel #5
0
 def setUp(self):
     user1 = db_utils.create_user()
     self.folder_object = db_utils.create_folder(user1)
     self.submission = db_utils.create_submission(
         user1, ratings.GENERAL.code, folderid=self.folder_object)
Beispiel #6
0
 def setUp(self):
     user1 = db_utils.create_user()
     self.folder_object = db_utils.create_folder(user1)
     self.submission = db_utils.create_submission(
         user1, ratings.GENERAL.code, folderid=self.folder_object)