Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit a7112dd

Browse files
committed
Merge pull request #350 from sparkica/fea_search2
Added searchable tags
2 parents 81676f3 + ae06252 commit a7112dd

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

web/templates/pages/view_event.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ <h1>{{ event.title }}</h1>
162162
<p>
163163
{% for tag in event.tags.all %}
164164
{% if forloop.last %}
165-
{{ tag.name }}
165+
<a href="{% url 'web.search_events' %}?q={{ tag.name|urlencode }}">{{ tag.name }}</a>
166166
{% else %}
167-
{{ tag.name }},
167+
<a href="{% url 'web.search_events' %}?q={{ tag.name|urlencode }}">{{ tag.name }}</a>,
168168
{% endif %}
169169
{% endfor %}
170170
</p>

web/tests/test_event_views.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# coding=utf-8
2+
13
import datetime
24
import pytest
35
import StringIO
@@ -60,6 +62,15 @@ def test_search_events_with_search_query(self):
6062
self.assertEquals(1,response.context['events'].count())
6163
self.assertEquals('SI', response.context['country'])
6264

65+
def test_search_events_with_unicode_tag_in_search_query(self):
66+
ApprovedEventFactory.create(tags=["jabolčna čežana","José", "Django"])
67+
response = self.client.get(reverse('web.search_events'), {'q':'čežana'}, REMOTE_ADDR='93.103.53.11')
68+
69+
self.assertEquals(1,response.context['events'].count())
70+
self.assertEquals('SI', response.context['country'])
71+
72+
73+
6374
def test_search_events_with_search_query_multiple_events(self):
6475
approved1 = ApprovedEventFactory.create(title="Event Arglebargle - Approved", country="SI")
6576
approved2 = ApprovedEventFactory.create(title="Event Arglebargle - Approved", country="AT")

0 commit comments

Comments
 (0)