Пример #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_override_langfile(self, lfht_mock):
     helpers.l10n_has_tag({'langfile': 'dude'}, 'abide', 'uli')
     lfht_mock.assert_called_with('uli', tag='abide')
Пример #4
0
 def test_gets_right_langfile(self, lfht_mock):
     helpers.l10n_has_tag({'langfile': 'dude'}, 'abide')
     lfht_mock.assert_called_with('dude', tag='abide')
Пример #5
0
 def test_override_langfile(self, lfht_mock):
     helpers.l10n_has_tag({'langfile': 'dude'}, 'abide', 'uli')
     lfht_mock.assert_called_with('uli', tag='abide')
Пример #6
0
 def test_gets_right_langfile(self, lfht_mock):
     helpers.l10n_has_tag({'langfile': 'dude'}, 'abide')
     lfht_mock.assert_called_with('dude', tag='abide')
Пример #7
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)
Пример #8
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')
Пример #9
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)
Пример #10
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")