def test_basic(self): output = url('crashstats:login') assert output == reverse('crashstats:login') # now with a arg output = url('crashstats:product_home', 'Firefox') assert output == reverse('crashstats:product_home', args=('Firefox',)) # now with a kwarg output = url('crashstats:product_home', product='Waterfox') assert output == reverse('crashstats:product_home', args=('Waterfox',))
def test_basic(self): output = url("crashstats:login") assert output == reverse("crashstats:login") # now with a arg output = url("crashstats:product_home", "Firefox") assert output == reverse("crashstats:product_home", args=("Firefox", )) # now with a kwarg output = url("crashstats:product_home", product="Waterfox") assert output == reverse("crashstats:product_home", args=("Waterfox", ))
def test_arg_cleanup(self): output = url('crashstats:product_home', 'Firefox\n') assert output == reverse('crashstats:product_home', args=('Firefox',)) output = url('crashstats:product_home', product='\tWaterfox') assert output == reverse('crashstats:product_home', args=('Waterfox',)) # this is something we've seen in the "wild" output = url('crashstats:product_home', u'Winterfox\\\\nn') assert output == reverse('crashstats:product_home', args=('Winterfoxnn',)) # check that it works if left as a byte string too output = url('crashstats:product_home', 'Winterfox\\\\nn') assert output == reverse('crashstats:product_home', args=('Winterfoxnn',))
def test_arg_cleanup(self): output = url("crashstats:product_home", "Firefox\n") assert output == reverse("crashstats:product_home", args=("Firefox", )) output = url("crashstats:product_home", product="\tWaterfox") assert output == reverse("crashstats:product_home", args=("Waterfox", )) # this is something we've seen in the "wild" output = url("crashstats:product_home", "Winterfox\\\\nn") assert output == reverse("crashstats:product_home", args=("Winterfoxnn", )) # check that it works if left as a byte string too output = url("crashstats:product_home", "Winterfox\\\\nn") assert output == reverse("crashstats:product_home", args=("Winterfoxnn", ))