'Test that using Python\'s %-formatting is properly escaped in blocktrans,
singular or plural'

@override_settings(LOCALE_PATHS=extended_locale_paths)
def test_percent_formatting_in_blocktrans(self):

    t_sing = Template(u'{%    load    i18n    %}{%    blocktrans    %}There    are    %(num_comments)s    comments{%    endblocktrans    %}')
    t_plur = Template(u'{%    load    i18n    %}{%    blocktrans    count    num    as    number    %}%(percent)s%    represents    {{    num    }}    object{%    plural    %}%(percent)s%    represents    {{    num    }}    objects{%    endblocktrans    %}')
    with translation.override(u'de'):
        self.assertEqual(t_sing.render(Context({u'num_comments': 42})), u'There    are    %(num_comments)s    comments')
        self.assertEqual(t_plur.render(Context({u'percent': 42, u'num': 1})), u'%(percent)s%    represents    1    object')
        self.assertEqual(t_plur.render(Context({u'percent': 42, u'num': 4})), u'%(percent)s%    represents    4    objects')
