예제 #1
0
 def test_can_return_all_the_topics_that_can_be_read_by_the_current_user_in_a_forum_without_its_descendants(self):
     # Setup
     feed = LastTopicsFeed()
     request = self.factory.get('/')
     request.user = self.user
     # Run
     feed.get_object(request, forum_pk=self.forum_2.pk, descendants=False)
     topics = feed.items()
     # Check
     assert list(topics) == [self.topic_2, ]
예제 #2
0
 def test_can_return_all_the_topics_that_can_be_read_by_the_current_user(self):
     # Setup
     feed = LastTopicsFeed()
     request = self.factory.get('/')
     request.user = self.user
     # Run
     feed.get_object(request)
     topics = feed.items()
     # Check
     assert list(topics) == [self.topic_3, self.topic_2, self.topic_1, ]
예제 #3
0
 def test_can_return_all_the_topics_that_can_be_read_by_the_current_user_in_a_forum_without_its_descendants(self):  # noqa
     # Setup
     feed = LastTopicsFeed()
     request = self.factory.get('/')
     request.user = self.user
     request.forum_permission_handler = PermissionHandler()
     # Run
     feed.get_object(request, forum_pk=self.forum_2.pk, descendants=False)
     topics = feed.items()
     # Check
     assert list(topics) == [self.topic_2, ]
예제 #4
0
 def test_can_return_all_the_topics_that_can_be_read_by_the_current_user(self):
     # Setup
     feed = LastTopicsFeed()
     request = self.factory.get('/')
     request.user = self.user
     request.forum_permission_handler = PermissionHandler()
     # Run
     feed.get_object(request)
     topics = feed.items()
     # Check
     assert list(topics) == [self.topic_3, self.topic_2, self.topic_1, ]
예제 #5
0
 def test_can_return_all_the_topics_that_can_be_read_by_the_current_user_in_a_forum_including_its_descendants(self):  # noqa
     # Setup
     feed = LastTopicsFeed()
     request = self.factory.get('/')
     request.user = self.user
     request.forum_permission_handler = PermissionHandler()
     # Run
     feed.get_object(request, forum_pk=self.forum_2.pk, descendants=True)
     topics = feed.items()
     # Check
     assert list(topics) == [self.topic_3, self.topic_2, ]
예제 #6
0
 def test_can_return_all_the_topics_that_can_be_read_by_the_current_user_in_a_forum_including_its_descendants(
         self):
     # Setup
     feed = LastTopicsFeed()
     request = self.factory.get('/')
     request.user = self.user
     # Run
     feed.get_object(request, forum_pk=self.forum_2.pk, descendants=True)
     topics = feed.items()
     # Check
     assert list(topics) == [
         self.topic_3,
         self.topic_2,
     ]