'Verify the KB Badge is awarded properly.'

def test_kb_badge(self):

    year = date.today().year
    u = UserFactory()
    b = BadgeFactory(slug=WIKI_BADGES['kb-badge']['slug'].format(year=year), title=WIKI_BADGES['kb-badge']['title'].format(year=year), description=WIKI_BADGES['kb-badge']['description'].format(year=year))
    d = DocumentFactory(locale=settings.WIKI_DEFAULT_LANGUAGE)
    ApprovedRevisionFactory.create_batch(9, creator=u, document=d)
    assert (not b.is_awarded_to(u))
    RevisionFactory(creator=u, document=d, is_approved=True)
    assert b.is_awarded_to(u)
