Child: [e5b93e] (diff)

Download this file

test_root.py    20 lines (15 with data), 705 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import allura
from alluratest.controller import TestController
from allura.lib import helpers as h
from allura.ext.search import search_main
from ming.orm.ormsession import ThreadLocalORMSession
class TestRootController(TestController):
def test_root_index_no_url(self):
response = self.app.get('/link/index')
assert 'Link is not configured' in response
def test_root_index_with_url(self):
response = self.app.get('/admin/link/options', validate_chunk=True)
response.form['url'] = 'http://www.google.com/'
response.form.submit()
redirected = self.app.get('/link/index').follow()
assert redirected.request.url == 'http://www.google.com/'