def test_args_in_url(self):
        '''in_url() should test the presence of a key in url'''
        url = url_for('site.home', key='value', other='other')

        with self.app.test_request_context(url):
            self.assertTrue(in_url('key'))
            self.assertTrue(in_url('other'))
            self.assertTrue(in_url('key', 'other'))
            self.assertFalse(in_url('fake'))
            self.assertFalse(in_url('key', 'fake'))
Exemple #2
0
    def test_args_in_url(self):
        '''in_url() should test the presence of a key in url'''
        url = url_for('site.home', key='value', other='other')

        with self.app.test_request_context(url):
            self.assertTrue(in_url('key'))
            self.assertTrue(in_url('other'))
            self.assertTrue(in_url('key', 'other'))
            self.assertFalse(in_url('fake'))
            self.assertFalse(in_url('key', 'fake'))
    def test_args_in_url(self, app):
        '''in_url() should test the presence of a key in url'''
        url = url_for('site.home', key='value', other='other')

        with app.test_request_context(url):
            assert in_url('key')
            assert in_url('other')
            assert in_url('key', 'other')
            assert not in_url('fake')
            assert not in_url('key', 'fake')
    def test_kwargs_in_url(self):
        '''in_url() should test the presence of key/value pair in url'''
        url = url_for('front.home', key='value', other='other')

        with self.app.test_request_context(url):
            self.assertTrue(in_url(key='value'))
            self.assertTrue(in_url(key='value', other='other'))
            self.assertFalse(in_url(key='other'))
            self.assertFalse(in_url(key='value', other='value'))

            self.assertTrue(in_url('other', key='value'))