def test_static_register(self): view.static('tests', 'ptah.view.tests:static/dir1') self._init_ptah() request = self._makeRequest() self._setRequest(request) self.assertEquals( view.static_url('tests', 'styles.css', request), 'http://localhost:8080/static/tests/styles.css') self.assertEquals( view.static_url('tests', '', request), 'http://localhost:8080/static/tests')
def test_static_register_url(self): from ptah.view import resources resources.STATIC.url = 'http://ptah.org/static' view.static('testsurl', 'ptah.view.tests:static/dir1') self._init_ptah() self.assertEquals( view.static_url('tests', 'styles.css', self.request), 'http://ptah.org/static/tests/styles.css')