Browse files

Add tests confirming 2edfe63

Also remove use of encode_name, |e does the same in templates.

More to come.
  • Loading branch information...
1 parent 2edfe63 commit c6d3be015a84004df58849b1ac996575684e88bd @cdent cdent committed Jul 22, 2012
View
12 test/test_search.py
@@ -144,3 +144,15 @@ def test_hsearch():
assert response['status'] == '200'
info = simplejson.loads(content)
assert len(info) == 4, len(info)
+
+def test_search_html():
+ response, content = http.request('http://0.0.0.0:8080/hsearch?q=monkeys')
+
+ assert response['status'] == '200', content
+
+ assert 'http://fnd.0.0.0.0:8080/One%20Two' in content
+ assert 'http://cdent.0.0.0.0:8080/three%20two%20one' in content
+
+ assert (
+ '<a href="http://0.0.0.0:8080/bags/fnd_public/tiddlers">fnd_public</a>'
+ in content)
View
4 tiddlywebplugins/templates/search.html
@@ -24,10 +24,10 @@
{%- if tiddler.modifier is not none -%}
<a href="{{ space_uri(environ, tiddler.modifier) }}">@{{tiddler.modifier}}</a>,&nbsp;
<a href="{{ '%s%s' % (space_uri(environ, tiddler.modifier),
- 'bags/%s/tiddlers' % encode_name(tiddler.bag)) }}">{{ tiddler.bag }}</a>)
+ 'bags/%s/tiddlers' % tiddler.bag|e )}}">{{ tiddler.bag }}</a>)
{%- else -%}
<a href="{{ '%s/%s' % (
- server_host, 'bags/%s/tiddlers' % encode_name(tiddler.bag)) }}">{{ tiddler.bag }}</a>)
+ server_host, 'bags/%s/tiddlers' % tiddler.bag|e) }}">{{ tiddler.bag }}</a>)
{%- endif -%}
</li>
{%- endfor -%}
View
1 tiddlywebplugins/tiddlyspace/htmlserialization.py
@@ -122,7 +122,6 @@ def list_tiddlers(self, tiddlers):
'revisions': revisions,
'tiddlers_url': tiddlers_url.decode('utf-8', 'replace'),
'space_uri': space_uri,
- 'encode_name': encode_name,
'query_string': query_string,
'container_type': container_type,
'container_name': container_name,

0 comments on commit c6d3be0

Please sign in to comment.