Пример #1
0
 def test_checks_template_by_default(self, tht_mock, lfht_mock):
     helpers.l10n_has_tag(
         {
             'langfile': 'dude',
             'template': 'home.html',
             'LANG': 'de'
         }, 'abide')
     tht_mock.assert_called_with('home.html', 'de', 'abide')
     self.assertFalse(lfht_mock.called)
Пример #2
0
 def test_uses_langfile(self, lfht_mock):
     """If langfile param specified should only check that file."""
     helpers.l10n_has_tag({
         'langfile': 'dude',
         'LANG': 'fr'
     },
                          'abide',
                          langfile='uli')
     lfht_mock.assert_called_with('uli', 'fr', 'abide')
Пример #3
0
 def test_checks_template_by_default(self, tht_mock, lfht_mock):
     helpers.l10n_has_tag({'langfile': 'dude',
                           'template': 'home.html',
                           'LANG': 'de'}, 'abide')
     tht_mock.assert_called_with('home.html', 'de', 'abide')
     self.assertFalse(lfht_mock.called)
Пример #4
0
 def test_uses_langfile(self, lfht_mock):
     """If langfile param specified should only check that file."""
     helpers.l10n_has_tag({'langfile': 'dude', 'LANG': 'fr'}, 'abide', langfile='uli')
     lfht_mock.assert_called_with('uli', 'fr', 'abide')