

def test_can_mark_subforums_read(self):
    new_topic = create_topic(forum=self.forum_2, poster=self.u1)
    PostFactory.create(topic=new_topic, poster=self.u1)
    new_topic = create_topic(forum=self.forum_4, poster=self.u1)
    PostFactory.create(topic=new_topic, poster=self.u1)
    correct_url = reverse('forum_tracking:mark_subforums_read', kwargs={
        'pk': self.top_level_cat_1.pk,
    })
    response = self.client.get(correct_url, follow=True)
    assert (response.status_code == 200)
    assert (list(self.tracks_handler.get_unread_forums(self.top_level_cat_1.get_descendants(include_self=True), self.user)) == [])
    assert (set(self.tracks_handler.get_unread_forums(Forum.objects.all(), self.user)) == set([self.top_level_cat_2, self.forum_4]))

dataset/ETHPy150Open ellmetha/django-machina/tests/functional/tracking/test_views.py TestMarkForumsReadView.test_can_mark_subforums_read/original