This repository was archived by the owner on Sep 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class Meta:
1313 creator = factory .LazyAttribute (lambda n : User .objects .get_or_create (username = 'test_user' )[0 ])
1414 title = "My Coding Event"
1515 description = "Some description"
16- location = "Nonexisting location "
16+ location = "Kersnikova ulica 4, 1000 Ljubljana, Slovenia "
1717
1818 event_url = "http://example.com"
1919 contact_person = "contact@example.com"
Original file line number Diff line number Diff line change @@ -60,6 +60,28 @@ def test_search_events_with_search_query(db, client):
6060
6161 approved1 .delete ()
6262
63+ def test_search_events_search_in_location (db , client ):
64+ approved1 = ApprovedEventFactory .create (title = 'Event Arglebargle - Approved' )
65+ response = client .get (reverse ('web.search_events' ), {'q' :'kersnikova' }, REMOTE_ADDR = '93.103.53.11' )
66+
67+ assert approved1 .get_absolute_url () in response .content
68+ approved1 .delete ()
69+
70+
71+ def test_search_events_search_in_wrong_location (db , client ):
72+ approved1 = ApprovedEventFactory .create (title = 'Event Arglebargle - Approved' )
73+ response = client .get (reverse ('web.search_events' ), {'q' :'celovška' }, REMOTE_ADDR = '93.103.53.11' )
74+
75+ assert approved1 .get_absolute_url () not in response .content
76+ approved1 .delete ()
77+
78+
79+ def test_search_events_search_in_wrong_location_again (db , client ):
80+ approved1 = ApprovedEventFactory .create (title = 'Event Arglebargle - Approved' )
81+ response = client .get (reverse ('web.search_events' ), {'q' :'Celovška 1' }, REMOTE_ADDR = '93.103.53.11' )
82+
83+ assert approved1 .get_absolute_url () not in response .content
84+ approved1 .delete ()
6385
6486
6587def test_search_events_with_unicode_tag_in_search_query (db , client ):
You can’t perform that action at this time.
0 commit comments