Example #1
0
def test_make_url_with_trailling_slash_on_both():
    base_url = 'http://my.unit.test/for/ma-cherie/'
    cherrypy.request.base = base_url

    expected_url = 'http://my.unit.test/for/ma-cherie/index'
    got_url = template.make_url('/index')
    assert got_url == expected_url, 'Expected %s, got %s' % (expected_url, got_url)
def test_make_url_with_trailling_slash_on_both():
    base_url = 'http://my.unit.test/for/ma-cherie/'
    cherrypy.request.base = base_url

    expected_url = 'http://my.unit.test/for/ma-cherie/index'
    got_url = template.make_url('/index')
    assert got_url == expected_url, 'Expected %s, got %s' % (expected_url,
                                                             got_url)
Example #3
0
 def get_permalink(self):
     return template.make_url('/user/%s/%s' % (self.owner.username,
                                               self.slug))