'Verify noindex on unsolved questions.'

def test_robots_noindex_unsolved(self):

    q = QuestionFactory()
    response = get(self.client, 'questions.details', args=[q.id])
    eq_(200, response.status_code)
    doc = pq(response.content)
    eq_(1, len(doc('meta[name=robots]')))
    a = AnswerFactory(question=q)
    response = get(self.client, 'questions.details', args=[q.id])
    eq_(200, response.status_code)
    doc = pq(response.content)
    eq_(1, len(doc('meta[name=robots]')))
    q.solution = a
    q.save()
    response = get(self.client, 'questions.details', args=[q.id])
    eq_(200, response.status_code)
    doc = pq(response.content)
    eq_(0, len(doc('meta[name=robots]')))
