def _toggle_watch_kbforum_as(self, username, document, turn_on=True):
        self.client.login(username=username, password='testpass')
        user = User.objects.get(username=username)
        watch = 'yes' if turn_on else 'no'
        post(self.client, 'wiki.discuss.watch_forum', {'watch': watch},
             args=[document.slug])
        # Watch exists or not, depending on watch.
        if turn_on:
            assert NewThreadEvent.is_notifying(user, document), (
                'NewThreadEvent should be notifying.')
        else:
            assert not NewThreadEvent.is_notifying(user, document), (
                'NewThreadEvent should not be notifying.')
        return document
Watch a discussion forum and return it.
dataset/ETHPy150Open mozilla/kitsune/kitsune/kbforums/tests/test_notifications.py/NotificationsTests._toggle_watch_kbforum_as