Пример #1
0
 def test_it(self):
     from karl.views.api import _get_static_rev
     context = testing.DummyModel()
     response = self._callFUT(context, testing.DummyRequest())
     self.assertEqual(response.location,
                      "http://example.com/static/%s/images/favicon.ico"
                             % _get_static_rev())
Пример #2
0
def get_static_url(request):
    # to avoid cyclical imports
    from karl.views.api import _get_static_rev

    app_url = request.application_url
    static_url = "%s/static/%s" % (app_url, _get_static_rev())
    return static_url