'Test that only solved questions are suggested.'

def test_only_solved(self):

    q1 = self._make_question(solved=True)
    q2 = self._make_question(solved=False)
    self.refresh()
    req = self.client.get(reverse('search.suggest'), {'q': 'emails'})
    ids = [q['id'] for q in req.data['questions']]
    assert (q1.id in ids)
    assert (q2.id not in ids)
    eq_(len(ids), 1)
