'Search wiki for topics, includes multiple.'

def test_wiki_topics(self):

    t1 = TopicFactory(slug='doesnotexist')
    t2 = TopicFactory(slug='extant')
    t3 = TopicFactory(slug='tagged')
    doc = DocumentFactory(locale=u'en-US', category=10)
    doc.topics.add(t2)
    RevisionFactory(document=doc, is_approved=True)
    doc = DocumentFactory(locale=u'en-US', category=10)
    doc.topics.add(t2)
    doc.topics.add(t3)
    RevisionFactory(document=doc, is_approved=True)
    self.refresh()
    topic_vals = ((t1.slug, 0), (t2.slug, 2), (t3.slug, 1), ([t2.slug, t3.slug], 1))
    qs = {'a': 1, 'w': 1, 'format': 'json'}
    for (topics, number) in topic_vals:
        qs.update({'topics': topics})
        response = self.client.get(reverse('search.advanced'), qs)
        eq_(number, json.loads(response.content)['total'])
