allura
Revisión | 3dcc34e0c475dec00bae0cbba40c84f2a1883ba5 (tree) |
---|---|
Tiempo | 2011-05-01 07:21:40 |
Autor | Rick Copeland <rcopeland@geek...> |
Commiter | Rick Copeland |
[#1831] Fix some tests
Signed-off-by: Rick Copeland <rcopeland@geek.net>
@@ -441,7 +441,9 @@ class MergeRequest(VersionedArtifact): | ||
441 | 441 | @LazyProperty |
442 | 442 | def downstream_repo_url(self): |
443 | 443 | with self.push_downstream_context(): |
444 | - return c.app.url | |
444 | + return c.app.repo.clone_url( | |
445 | + category='ro', | |
446 | + username=c.user.username) | |
445 | 447 | |
446 | 448 | def push_downstream_context(self): |
447 | 449 | return h.push_context(self.downstream.project_id, self.downstream.mount_point) |
@@ -10,7 +10,7 @@ | ||
10 | 10 | <div class="grid-6"> </div> |
11 | 11 | <div class="grid-9" style="text-align: right"> |
12 | 12 | <label for="{{ widget.context_for(widget.fields[1])['id'] }}"> |
13 | - URL: http://{{environ['HTTP_HOST']}}{{neighborhood.url()}} | |
13 | + URL: http://{{request.environ['HTTP_HOST']}}{{neighborhood.url()}} | |
14 | 14 | </label> |
15 | 15 | </div> |
16 | 16 | <div class="grid-8">{{widget.display_field_by_idx(1)|safe}}<br><div id="name_availablity" style="display:none"></div></div> |
@@ -204,7 +204,7 @@ class TestMergeRequest(_TestWithRepoAndCommit): | ||
204 | 204 | assert mr.creator_name == u.get_pref('display_name') |
205 | 205 | assert mr.creator_url == u.url() |
206 | 206 | assert mr.downstream_url == '/p/test/test2/' |
207 | - assert mr.downstream_repo_url == 'http://svn.localhost/p/test/test2/trunk' | |
207 | + assert mr.downstream_repo_url == 'http://svn.localhost/p/test/test2/trunk', mr.downstream_repo_url | |
208 | 208 | assert mr.commits == [ self._make_commit('foo')[0] ] |
209 | 209 | |
210 | 210 | class TestLastCommitFor(_TestWithRepoAndCommit): |
@@ -76,15 +76,16 @@ class Decoration(object): | ||
76 | 76 | self._before_validate.append(func) |
77 | 77 | |
78 | 78 | def do_validate_params(self, params): |
79 | - # An object used by FormEncode to get translator function | |
80 | 79 | for hook in self._before_validate: |
81 | 80 | hook(params) |
82 | 81 | if self._validators: |
83 | 82 | state = type('state', (), {}) |
84 | - if hasattr(self._validators, 'to_python'): | |
83 | + if isinstance(self._validators, schema.Schema): | |
85 | 84 | params = self._validators.to_python(params, state) |
86 | - if hasattr(self._validators, 'validate'): | |
85 | + elif hasattr(self._validators, 'validate'): | |
87 | 86 | params = self._validators.validate(params, state) |
87 | + else: | |
88 | + assert False, 'Invalid validator: %s' % self._validators | |
88 | 89 | return params |
89 | 90 | |
90 | 91 | def do_render_response(self, result): |