'Tests that the simple search doesn\'t show forums
This verifies that we\'re only showing documents of the type
that should be shown and that the filters on model are working
correctly.
Bug #767394'

def test_only_show_wiki_and_questions(self):

    p = ProductFactory(slug=u'desktop')
    ques = QuestionFactory(title=u'audio', product=p)
    ans = AnswerFactory(question=ques, content=u'volume')
    AnswerVoteFactory(answer=ans, helpful=True)
    doc = DocumentFactory(title=u'audio', locale=u'en-US', category=10)
    doc.products.add(p)
    RevisionFactory(document=doc, is_approved=True)
    thread1 = ThreadFactory(title=u'audio')
    PostFactory(thread=thread1)
    self.refresh()
    response = self.client.get(reverse('search'), {'q': 'audio', 'format': 'json'})
    eq_(200, response.status_code)
    content = json.loads(response.content)
    eq_(content['total'], 2)
    ques.is_archived = True
    ques.save()
    doc.is_archived = True
    doc.save()
    self.refresh()
    response = self.client.get(reverse('search'), {'q': 'audio', 'format': 'json'})
    eq_(200, response.status_code)
    content = json.loads(response.content)
    eq_(content['total'], 0)
