Beispiel #1
0
    def test_static_register(self):
        view.static('tests', 'memphis.view.tests:static/dir1')
        self._init_memphis()

        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')
Beispiel #2
0
    def test_static_register_url(self):
        from memphis.view import resources
        resources.STATIC.url = 'http://memphis.org/static'

        view.static('testsurl', 'memphis.view.tests:static/dir1')
        self._init_memphis()

        self.assertEquals(
            view.static_url('tests', 'styles.css', self.request),
            'http://memphis.org/static/tests/styles.css')