Exemplo n.º 1
0
def test_collect_static_asset():
    """Collect static files and stash them with MD5 sums."""
    c = Configurator()
    sap = DefaultStaticAssetPolicy(c)

    sap.add_static_view("websauna-static", "websauna.system:static")
    collected = sap.collect_static()

    # Check one resource from the collectin to see we succeeded
    assert collected["websauna-static"]["pyramid-32x32.png"] == 'perma-asset/pyramid-32x32.c453183eee6627ff09e49f0384cededd.png'
Exemplo n.º 2
0
def test_collect_recurse():
    """Check another more complicated static file folder collect"""
    c = Configurator()
    sap = DefaultStaticAssetPolicy(c)

    sap.add_static_view("deform-static", "deform:static")
    collected = sap.collect_static()

    assert len(collected) > 0

    # Check one resource from the collectin to see we succeeded
    assert collected["deform-static"]["pickadate/translations/ja_JP.js"].startswith( 'perma-asset/pickadate/translations/ja_JP.')
Exemplo n.º 3
0
 def create_static_asset_policy(self):
     """Override to have our own static asset policy."""
     from websauna.system.http.static import DefaultStaticAssetPolicy
     return DefaultStaticAssetPolicy(self.config)
Exemplo n.º 4
0
 def create_static_asset_policy(self):
     """Override to have our own static asset policy."""
     return DefaultStaticAssetPolicy(self.config)