Ejemplo n.º 1
0
 def test_youngest_file_wins(self, template_mock, mtime_mock):
     tmpl_name = 'the_dude_is_a_template.html'
     template_mock.return_value.filename = tmpl_name
     mtimes = [1378762234.0, 1378762235.0]
     mtime_mock.side_effect = mtimes
     func = template_last_modified(tmpl_name)
     datestamp = func({})
     self.assertEqual(datestamp, datetime.fromtimestamp(max(mtimes)))
     mtime_mock.assert_any_call(tmpl_name)
     langfile = '{0}/locale/en-US/tabzilla/tabzilla.lang'.format(settings.ROOT)
     mtime_mock.assert_any_call(langfile)
Ejemplo n.º 2
0
 def test_youngest_file_wins(self, template_mock, mtime_mock):
     tmpl_name = 'the_dude_is_a_template.html'
     template_mock.return_value.filename = tmpl_name
     mtimes = [1378762234.0, 1378762235.0]
     mtime_mock.side_effect = mtimes
     func = template_last_modified(tmpl_name)
     datestamp = func({})
     self.assertEqual(datestamp, datetime.fromtimestamp(max(mtimes)))
     mtime_mock.assert_any_call(tmpl_name)
     langfile = '{0}/locale/en-US/tabzilla/tabzilla.lang'.format(settings.ROOT)
     mtime_mock.assert_any_call(langfile)