Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
 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))
Ejemplo n.º 3
0
 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))