Esempio n. 1
0
 def test_requiring_existing_assets_does_not_raise(self):
     with use_assets('a.css', 'b.css', 'c.js'):
         try:
             require_assets('a.css', 'c.js')
         except AssetMissing:
             raise
             self.fail('AssetMissing raised unexpectedly')
 def get_dashboard_view_context(self, name):
     """ Helper function to create a dashboard view and invoke
         it's get_context_data method
     """
     dashboard_view = DashboardView()
     view_args = {'name': 'dashboard1'}
     dashboard_view.kwargs = view_args
     assets = [
         'file.js', 'app/file.js', 'file.css',
         'app/file.css', 'some.js', 'app2/file.js',
         'some.css', 'app2/file.css',
         'dashboard/dashboard.css'
     ]
     with use_assets(*assets):
         context_data = dashboard_view.get_context_data(**view_args)
     return context_data
Esempio n. 3
0
 def test_requiring_missing_assets_does_raise(self):
     with use_assets('a.css', 'b.css', 'c.js'):
         with self.assertRaises(AssetMissing):
             require_assets('a.css', 'missing.js')