예제 #1
0
    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',))
예제 #2
0
    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',))
예제 #3
0
    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", ))
예제 #4
0
    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',))
예제 #5
0
    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',))
예제 #6
0
    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", ))