def test_notify(self): from pyramid.events import BeforeRender from fanstatic.core import get_needed self.config.include('rebecca.fanstatic') self.config.add_fanstatic_resources(['js.jquery.jquery',], r'.*\.mak') request = testing.DummyRequest(registry=self.config.registry) system_values = {'request': request, 'renderer_name': 'test.mak'} event = BeforeRender(system_values) self.config.registry.notify(event) from js.jquery import jquery needed = get_needed() self.assertIn(jquery, needed._resources)
def need(self): needed = get_needed() needed.need(self, None)