Parent: [e5b93e] (diff)

Download this file

test_root.py    21 lines (14 with data), 705 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
from nose.tools import assert_equals
from ming.orm import ThreadLocalORMSession
from allura import model as M
from alluratest.controller import TestController
class TestRootController(TestController):
def test_root_redirect(self):
p_nbhd = M.Neighborhood.query.get(name='Projects')
project = M.Project.query.get(shortname='test', neighborhood_id=p_nbhd._id)
project.set_tool_data('sfx', unix_group_name='foobar')
ThreadLocalORMSession.flush_all()
response = self.app.get('/downloads/', status=301)
assert_equals(response.location, 'http://localhost/projects/foobar/files/')
def test_root(self):
self.app.get('/downloads/', status=404)