In both sfpy & allura, tg.decorators.with_trailing_slash and without_trailing_slash should be monkey-patched so they cause a 301 instead of 302. I'd rather not copy the whole functions, even though they're short, because the logic is a little complex. Maybe we can capture the exception that it raises and then re-raise a 301 exception.
Changes are on allura and sfpy js/2801. To test hit some urls that use the decorators and make sure you get a 301 like: curl http://sf-jsteele-6025.sb.sf.net/create. I couldn't figure out how to wrap the decorators like the description suggests, but there were only 2 lines copied per function.
I merged these to dev, but later realized that while these work in practice, they don't apply to our tests. Maybe the monkeypatching needs to happen somewhere else? It isn't the end of the world, but I'd much prefer that our tests function the same as paster/mod_wsgi. Of course, that'll mean a lot of s/302/301/ in our tests too.
I added a test for the redirect on js/2801. We are getting 301s correctly inside the tests, but we didn't have any tests before that tested the slashiness decorators (presumably they are tested in tg). The tests that currently exist and look for 302s are for form redirects which should stay 302s, right? As in, submit the form and get redirected to another page when successful.
The problem is in sfpy - test_project_without_slash and test_folder_without_slash should pass with 301s