コード例 #1
0
 def test_template_filter(self):
     content = """
     #content {background-image: url("{{ STATIC_URL|default:stuff }}/images/bg.png");}
     #footer {font-weight: {{ gimmick }};}
     """
     input = """
     #content {background-image: url("thing/images/bg.png");}
     #footer {font-weight: bold;}
     """
     self.assertEqual(input, TemplateFilter(content).input())
コード例 #2
0
 def test_template_filter(self):
     settings.COMPRESS_TEMPLATE_FILTER_CONTEXT = {
         'stuff': 'thing',
         'gimmick': 'bold'
     }
     content = """
     #content {background-image: url("{{ STATIC_URL|default:stuff }}/images/bg.png");}
     #footer {font-weight: {{ gimmick }};}
     """
     input = """
     #content {background-image: url("thing/images/bg.png");}
     #footer {font-weight: bold;}
     """
     self.assertEqual(input, TemplateFilter(content).input())