allura
修訂 | 7a6154fd94514370e06b44df95a7d8ff7983f10c (tree) |
---|---|
時間 | 2011-04-30 02:08:35 |
作者 | Rick Copeland <rcopeland@geek...> |
Commiter | Rick Copeland |
[#1831] Tests now passing
Signed-off-by: Rick Copeland <rcopeland@geek.net>
@@ -16,9 +16,7 @@ class AttachmentsController(BaseController): | ||
16 | 16 | @expose() |
17 | 17 | def _lookup(self, filename=None, *args): |
18 | 18 | if filename: |
19 | - if not args: | |
20 | - filename = request.path.rsplit('/', 1)[-1] | |
21 | - filename=unquote(filename) | |
19 | + filename = unicode(filename, 'utf-8') | |
22 | 20 | return self.AttachmentControllerClass(filename, self.artifact), args |
23 | 21 | else: |
24 | 22 | raise exc.HTTPNotFound |
@@ -23,6 +23,7 @@ def override_template(func, template): | ||
23 | 23 | def without_trailing_slash(func): |
24 | 24 | from tg import redirect |
25 | 25 | def _check_path(params): |
26 | + if request.method != 'GET': return | |
26 | 27 | if request.path.endswith('/'): |
27 | 28 | redirect(request.url.replace(request.path, request.path[:-1], 1)) |
28 | 29 | before_validate(_check_path)(func) |
@@ -31,6 +32,7 @@ def without_trailing_slash(func): | ||
31 | 32 | def with_trailing_slash(func): |
32 | 33 | from tg import redirect |
33 | 34 | def _check_path(params): |
35 | + if request.method != 'GET': return | |
34 | 36 | if not request.path.endswith('/'): |
35 | 37 | redirect(request.url.replace(request.path, request.path + '/', 1)) |
36 | 38 | before_validate(_check_path)(func) |
@@ -31,6 +31,8 @@ class ForgeSVNApp(RepositoryApp): | ||
31 | 31 | default_root = RepoRootController() |
32 | 32 | self.root.refresh = default_root.refresh |
33 | 33 | self.root.feed = default_root.feed |
34 | + setattr(self.root, 'feed.rss', self.root.feed) | |
35 | + setattr(self.root, 'feed.atom', self.root.feed) | |
34 | 36 | self.root.commit_browser = default_root.commit_browser |
35 | 37 | |
36 | 38 | @LazyProperty |
@@ -536,7 +536,8 @@ class TestFunctionalController(TestController): | ||
536 | 536 | 'summary': 'This is not too long.', |
537 | 537 | 'terms': 'aaa', |
538 | 538 | 'old_summary': '', |
539 | - 'sort': ''}).follow() | |
539 | + 'sort': ''}) | |
540 | + r = r.follow() | |
540 | 541 | r = self.app.get('/bugs/') |
541 | 542 | assert sidebar_contains(r, 'This is not too long.') |
542 | 543 | r = self.app.post('/admin/bugs/bins/save_bin',{ |
@@ -658,7 +658,7 @@ class BinController(BaseController): | ||
658 | 658 | c.bin_form = W.bin_form |
659 | 659 | return dict(q=q or '', bin=bin or '', modelname='Bin', page='New Bin', globals=self.app.globals) |
660 | 660 | |
661 | - @with_trailing_slash | |
661 | + @without_trailing_slash | |
662 | 662 | @h.vardec |
663 | 663 | @expose() |
664 | 664 | @require_post() |
@@ -43,8 +43,8 @@ class TestRootController(TestController): | ||
43 | 43 | |
44 | 44 | def test_root_new_search(self): |
45 | 45 | self.app.get('/wiki/TEST/') |
46 | - response = self.app.get('/wiki/search?q=TEST') | |
47 | - assert 'Search wiki: TEST' in response | |
46 | + response = self.app.get('/wiki/search/?q=TEST') | |
47 | + assert 'Search wiki: TEST' in response, response.showbrowser() | |
48 | 48 | |
49 | 49 | def test_page_index(self): |
50 | 50 | response = self.app.get('/wiki/TEST/') |
@@ -1,4 +1,4 @@ | ||
1 | -from pylons import c, g | |
1 | +from tg import c, g | |
2 | 2 | |
3 | 3 | from alluratest.controller import setup_basic_test, setup_global_objects |
4 | 4 | from allura import model as M |