  
              # Raise exception if we don't have 3 args, last one an integer
              'widthratio08': ('{% widthratio %}', {}, template.TemplateSyntaxError),
              'widthratio09': ('{% widthratio a b %}', {'a':50,'b':100}, template.TemplateSyntaxError),
              'widthratio10': ('{% widthratio a b 100.0 %}', {'a':50,'b':100}, template.TemplateSyntaxError),
  
              ### WITH TAG ########################################################
              'with01': ('{% with dict.key as key %}{{ key }}{% endwith %}', {'dict': {'key':50}}, '50'),
              'with02': ('{{ key }}{% with dict.key as key %}{{ key }}-{{ dict.key }}-{{ key }}{% endwith %}{{ key }}', {'dict': {'key':50}}, ('50-50-50', 'INVALID50-50-50INVALID')),
  
 
</s> remove     try:
        max_width = int(max_width)
    except ValueError:
        raise TemplateSyntaxError("widthratio final argument must be an integer")
 </s> add  </s> remove                           parser.compile_filter(max_value_expr), max_width)
 </s> add                           parser.compile_filter(max_value_expr),
                          parser.compile_filter(max_width)) </s> remove             ratio = (value / maxvalue) * int(self.max_width)
 </s> add             ratio = (value / maxvalue) * max_width
            'widthratio10': ('{% widthratio a b 100.0 %}', {'a':50,'b':100}, '50'),
            
            # #10043: widthratio should allow max_width to be a variable
            'widthratio11': ('{% widthratio a b c %}', {'a':50,'b':100, 'c': 100}, '50'),
  
              # Raise exception if we don't have 3 args, last one an integer
              'widthratio08': ('{% widthratio %}', {}, template.TemplateSyntaxError),
              'widthratio09': ('{% widthratio a b %}', {'a':50,'b':100}, template.TemplateSyntaxError),
            'widthratio10': ('{% widthratio a b 100.0 %}', {'a':50,'b':100}, '50'),
            
            # #10043: widthratio should allow max_width to be a variable
            'widthratio11': ('{% widthratio a b c %}', {'a':50,'b':100, 'c': 100}, '50'),
  
              ### WITH TAG ########################################################
              'with01': ('{% with dict.key as key %}{{ key }}{% endwith %}', {'dict': {'key':50}}, '50'),
              'with02': ('{{ key }}{% with dict.key as key %}{{ key }}-{{ dict.key }}-{{ key }}{% endwith %}{{ key }}', {'dict': {'key':50}}, ('50-50-50', 'INVALID50-50-50INVALID')),
  
keep keep keep keep replace keep keep keep keep keep
 Fixed #10043 -- widthratio tag now accepts a variable for the max_width argument.

The max_width argument now passes through FilterExpression which by side-affect
allows float values, but will be truncated.

Thanks obeattie and Eric Holscher for patches.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10352 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
tests/regressiontests/templates/tests.py