'Verify that the l10n overview readout treats archived docs consistently.
Bug 1012384'

def test_miscounting_archived(self):

    locale = 'nl'
    parent1 = DocumentFactory(category=CANNED_RESPONSES_CATEGORY, is_archived=False)
    translation1 = DocumentFactory(parent=parent1, locale=locale)
    parent2 = DocumentFactory(category=CANNED_RESPONSES_CATEGORY, is_archived=True)
    translation2 = DocumentFactory(parent=parent2, locale=locale)
    trans_rev1 = ApprovedRevisionFactory(document=parent1, is_ready_for_localization=True)
    ApprovedRevisionFactory(document=translation1, based_on=trans_rev1)
    trans_rev2 = ApprovedRevisionFactory(document=parent2, is_ready_for_localization=True)
    ApprovedRevisionFactory(document=translation2, based_on=trans_rev2)
    translation2.is_archived = False
    ModelBase.save(translation2)
    eq_(translation2.is_archived, False)
    overview = l10n_overview_rows(locale)
    eq_(1, overview['all']['denominator'])
    eq_(1, overview['all']['numerator'])
