def test_discussion_forum_with_restricted_forums(self):
        """Tests who can see restricted forums in search form."""
        # This is a long test, but it saves us from doing the setup
        # twice.
        forum1 = ForumFactory(name=u'ou812forum')
        thread1 = ThreadFactory(forum=forum1, title=u'audio 2')
        PostFactory(thread=thread1)

        forum2 = RestrictedForumFactory(name=u'restrictedkeepout')
        thread2 = ThreadFactory(forum=forum2, title=u'audio 2')
        PostFactory(thread=thread2)

        self.refresh()

        # Get the Advanced Search Form as an anonymous user
        response = self.client.get(reverse('search.advanced'), {'a': '2'})
        eq_(200, response.status_code)

        # Regular forum should show up
        assert response.content in 'ou812forum'

        # Restricted forum should not show up
        assert 'restrictedkeepout' not in response.content

        u = UserFactory()
        g = GroupFactory()
        g.user_set.add(u)
        ct = ContentType.objects.get_for_model(forum2)
        PermissionFactory(
            codename='forums_forum.view_in_forum',
            content_type=ct,
            object_id=forum2.id,
            group=g)

        # Get the Advanced Search Form as a logged in user
        self.client.login(username=u.username, password='testpass')
        response = self.client.get(reverse('search.advanced'), {'a': '2'})
        eq_(200, response.status_code)

        # Both forums should show up for authorized user
        assert 'ou812forum' in response.content
        assert 'restrictedkeepout' in response.content
dataset/ETHPy150Open mozilla/kitsune/kitsune/search/tests/test_search_advanced.py/AdvancedSearchTests.test_discussion_forum_with_restricted_forums/swapped operands of `in`