'Document templates should have a noindex meta tag.'

def test_templates_noindex(self):

    d = DocumentFactory()
    r = ApprovedRevisionFactory(document=d)
    response = self.client.get(r.document.get_absolute_url())
    eq_(200, response.status_code)
    doc = pq(response.content)
    eq_(0, len(doc('meta[name=robots]')))
    d.category = TEMPLATES_CATEGORY
    d.title = (TEMPLATE_TITLE_PREFIX + d.title)
    d.save()
    cache.clear()
    response = self.client.get(r.document.get_absolute_url())
    eq_(200, response.status_code)
    doc = pq(response.content)
    eq_(doc('meta[name=robots]')[0].attrib['content'], 'noindex')
