def test_score_filter_greater_than_score(self): Injector.get_settings_manager().restrict_by_score = True post_filter = PostFilter() post = MockPrawPost(score=5000) self.assertTrue(post_filter.score_filter(post)) post = MockPrawPost(score=2000) self.assertFalse(post_filter.score_filter(post))
def test_score_filter_less_than_score(self): settings_manager = Injector.get_settings_manager() settings_manager.restrict_by_score = True settings_manager.score_limit_operator = 'LESS' post_filter = PostFilter() post = MockPrawPost(score=1000) self.assertTrue(post_filter.score_filter(post)) post = MockPrawPost(score=4000) self.assertFalse(post_filter.score_filter(post))
def test_score_filter_no_limit_restriction(self): Injector.get_settings_manager().restrict_by_score = False post_filter = PostFilter() post = MockPrawPost(score=10000) self.assertTrue(post_filter.score_filter(post))