def test_load_template_on_filesystem(self, filesystem_loader, app_directories_loader): filesystem_loader.side_effect = TemplateDoesNotExist() app_directories_loader.side_effect = TemplateDoesNotExist() from django_mobile.loader import Loader loader = Loader() set_flavour('mobile') try: loader.load_template('base.html', template_dirs=None) except TemplateDoesNotExist: pass self.assertEqual(filesystem_loader.call_args[0][0], 'mobile/base.html') self.assertEqual(app_directories_loader.call_args[0][0], 'mobile/base.html') set_flavour('full') try: loader.load_template('base.html', template_dirs=None) except TemplateDoesNotExist: pass self.assertEqual(filesystem_loader.call_args[0][0], 'full/base.html') self.assertEqual(app_directories_loader.call_args[0][0], 'full/base.html')
def testing(filesystem_loader, app_directories_loader): filesystem_loader.side_effect = TemplateDoesNotExist('error') app_directories_loader.side_effect = TemplateDoesNotExist('error') from django_mobile.loader import Loader loader = Loader(get_engine()) set_flavour('mobile') try: loader.load_template('base.html') except TemplateDoesNotExist: pass self.assertEqual(filesystem_loader.call_args, 'mobile/base.html') self.assertEqual(app_directories_loader.call_args, 'mobile/base.html') set_flavour('full') try: loader.load_template('base.html') except TemplateDoesNotExist: pass self.assertEqual(filesystem_loader.call_args, 'full/base.html') self.assertEqual(app_directories_loader.call_args, 'full/base.html')