Esempio n. 1
0
    def test_basic(self):
        output = url('crashstats:login')
        assert output == reverse('crashstats:login')

        # now with a arg
        output = url('home:home', 'Firefox')
        assert output == reverse('home:home', args=('Firefox', ))

        # now with a kwarg
        output = url('home:home', product='Waterfox')
        assert output == reverse('home:home', args=('Waterfox', ))
Esempio n. 2
0
    def test_basic(self):
        output = url('crashstats:login')
        eq_(output, reverse('crashstats:login'))

        # now with a arg
        output = url('home:home', 'Firefox')
        eq_(output, reverse('home:home', args=('Firefox',)))

        # now with a kwarg
        output = url('home:home', product='Waterfox')
        eq_(output, reverse('home:home', args=('Waterfox',)))
Esempio n. 3
0
    def test_arg_cleanup(self):
        output = url('home:home', 'Firefox\n')
        assert output == reverse('home:home', args=('Firefox', ))

        output = url('home:home', product='\tWaterfox')
        assert output == reverse('home:home', args=('Waterfox', ))

        # this is something we've seen in the "wild"
        output = url('home:home', u'Winterfox\\\\nn')
        assert output == reverse('home:home', args=('Winterfoxnn', ))

        # check that it works if left as a byte string too
        output = url('home:home', 'Winterfox\\\\nn')
        assert output == reverse('home:home', args=('Winterfoxnn', ))
Esempio n. 4
0
    def test_arg_cleanup(self):
        output = url('home:home', 'Firefox\n')
        eq_(output, reverse('home:home', args=('Firefox',)))

        output = url('home:home', product='\tWaterfox')
        eq_(output, reverse('home:home', args=('Waterfox',)))

        # this is something we've seen in the "wild"
        output = url('home:home', u'Winterfox\\\\nn')
        eq_(output, reverse('home:home', args=('Winterfoxnn',)))

        # check that it works if left as a byte string too
        output = url('home:home', 'Winterfox\\\\nn')
        eq_(output, reverse('home:home', args=('Winterfoxnn',)))